-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
42 lines (35 loc) · 940 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"log"
"math/rand"
"os"
"time"
"github.com/mitchellh/cli"
)
func main() {
c := cli.NewCLI("app", "1.0.0")
c.Args = os.Args[1:]
c.Commands = map[string]cli.CommandFactory{
"run": prepareRun,
"get": prepareGet,
"ls": prepareGet,
"restore": prepareRestore,
"rm": prepareRm,
"cmp": prepareCmp,
}
c.HiddenCommands = []string{"ls"} // alias of get
rand.Seed(time.Now().Unix())
exitStatus, err := c.Run()
if err != nil {
log.Fatalf("err ocurred initializing cli: %v", err)
}
os.Exit(exitStatus)
}
var (
defaultCmd = []string{"go", "test", "-bench=.", "-benchmem"}
)
const (
//https://hub.docker.com/layers/golang/library/golang/alpine3.15/images/sha256-f28579af8a31c28fc180fb2e26c415bf6211a21fb9f3ed5e81bcdbf062c52893
minDockerImage = "golang@sha256:f28579af8a31c28fc180fb2e26c415bf6211a21fb9f3ed5e81bcdbf062c52893"
defaultUnixSocket = "/var/run/docker.sock"
)