diff --git a/.travis.yml b/.travis.yml index cefb500bb2..bfad880be1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,10 @@ sudo: false install: - export GOPATH=${TRAVIS_BUILD_DIR}/Godeps/_workspace:$GOPATH - export PATH=${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$PATH + - go get code.google.com/p/go.tools/cmd/vet script: - script/validate-dco - script/validate-gofmt + - go vet ./... - go test -v -race ./... diff --git a/flags.go b/flags.go index 514a3fd00a..bdb78224a5 100644 --- a/flags.go +++ b/flags.go @@ -1,10 +1,11 @@ package main import ( - "github.com/codegangsta/cli" "os" "path/filepath" "runtime" + + "github.com/codegangsta/cli" ) func homepath(p string) string { @@ -34,9 +35,13 @@ var ( Usage: "ip to advertise", EnvVar: "SWARM_ADDR", } + + // hack for go vet + flHostsValue = cli.StringSlice([]string{"tcp://127.0.0.1:2375"}) + flHosts = cli.StringSliceFlag{ Name: "host, H", - Value: &cli.StringSlice{"tcp://127.0.0.1:2375"}, + Value: &flHostsValue, Usage: "ip/socket to listen on", EnvVar: "SWARM_HOST", } @@ -79,9 +84,13 @@ var ( Usage: "placement strategy to use [binpacking, random]", Value: "binpacking", } + + // hack for go vet + flFilterValue = cli.StringSlice([]string{"constraint", "affinity", "health", "port"}) + flFilter = cli.StringSliceFlag{ Name: "filter, f", Usage: "filter to use [constraint, affinity, health, port]", - Value: &cli.StringSlice{"constraint", "affinity", "health", "port"}, + Value: &flFilterValue, } )