Merge pull request #340 from vieux/go_vet

hack code to not error on go vet
This commit is contained in:
Andrea Luzzardi 2015-02-02 13:15:09 -08:00
commit a9641bcfe9
2 changed files with 14 additions and 3 deletions

View File

@ -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 ./...

View File

@ -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,
}
)