travis: Bump to golang 1.10

This requires breaking changes in gofmt. It is hilarious that this was
changed. Oh well. This also moves to the latest stable etcd. Lastly,
this changes the `go vet` testing to test by package, since the new go
vet changed how it works and now fails without this change.
This commit is contained in:
James Shubin
2018-05-06 16:19:21 -04:00
parent 56db31ca43
commit d990d2ad86
12 changed files with 35 additions and 59 deletions

View File

@@ -2,8 +2,8 @@ language: go
os:
- linux
go:
- 1.9.x
- 1.10.x
- 1.11.x
- tip
go_import_path: github.com/purpleidea/mgmt
sudo: true
@@ -26,13 +26,13 @@ script: 'make test'
matrix:
fast_finish: false
allow_failures:
- go: 1.10.x
- go: 1.11.x
- go: tip
- os: osx
# include only one build for osx for a quicker build as the nr. of these runners are sparse
include:
- os: osx
go: 1.9.x
go: 1.10.x
# the "secure" channel value is the result of running: ./misc/travis-encrypt.sh
# with a value of: irc.freenode.net#mgmtconfig to eliminate noise from forks...

View File

@@ -13,7 +13,7 @@ Once you're familiar with the general idea, please start hacking...
### Installing golang
* You need golang version 1.9 or greater installed.
* You need golang version 1.10 or greater installed.
* To install on rpm style systems: `sudo dnf install golang`
* To install on apt style systems: `sudo apt install golang`
* To install on macOS systems install [Homebrew](https://brew.sh)
@@ -89,7 +89,7 @@ required for running the _test_ suite.
### Build
* `golang` 1.9 or higher (required, available in some distros and distributed
* `golang` 1.10 or higher (required, available in some distros and distributed
as a binary officially by [golang.org](https://golang.org/dl/))
### Runtime

View File

@@ -60,9 +60,7 @@ func (obj *MyGAPI) Cli(c *cli.Context, fs engine.Fs) (*gapi.Deploy, error) {
Name: obj.Name,
Noop: c.GlobalBool("noop"),
Sema: c.GlobalInt("sema"),
GAPI: &MyGAPI{
// TODO: add properties here...
},
GAPI: &MyGAPI{},
}, nil
}
return nil, nil // we weren't activated!

View File

@@ -65,9 +65,7 @@ func (obj *MyGAPI) Cli(c *cli.Context, fs engine.Fs) (*gapi.Deploy, error) {
Name: obj.Name,
Noop: c.GlobalBool("noop"),
Sema: c.GlobalInt("sema"),
GAPI: &MyGAPI{
// TODO: add properties here...
},
GAPI: &MyGAPI{},
}, nil
}
return nil, nil // we weren't activated!

View File

@@ -60,9 +60,7 @@ func (obj *MyGAPI) Cli(c *cli.Context, fs engine.Fs) (*gapi.Deploy, error) {
Name: obj.Name,
Noop: c.GlobalBool("noop"),
Sema: c.GlobalInt("sema"),
GAPI: &MyGAPI{
// TODO: add properties here...
},
GAPI: &MyGAPI{},
}, nil
}
return nil, nil // we weren't activated!

View File

@@ -62,9 +62,7 @@ func (obj *MyGAPI) Cli(c *cli.Context, fs engine.Fs) (*gapi.Deploy, error) {
Name: obj.Name,
Noop: c.GlobalBool("noop"),
Sema: c.GlobalInt("sema"),
GAPI: &MyGAPI{
// TODO: add properties here...
},
GAPI: &MyGAPI{},
}, nil
}
return nil, nil // we weren't activated!

View File

@@ -60,9 +60,7 @@ func (obj *MyGAPI) Cli(c *cli.Context, fs engine.Fs) (*gapi.Deploy, error) {
Name: obj.Name,
Noop: c.GlobalBool("noop"),
Sema: c.GlobalInt("sema"),
GAPI: &MyGAPI{
// TODO: add properties here...
},
GAPI: &MyGAPI{},
}, nil
}
return nil, nil // we weren't activated!

View File

@@ -11,12 +11,6 @@ ROOT=$(dirname "${BASH_SOURCE}")/..
cd "${ROOT}"
. test/util.sh
#GO_VERSION=($(go version))
#
#if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3|go1.4|go1.5|go1.6|go1.7|go1.8|go1.9|devel') ]]; then
# fail_test "Unknown go version '${GO_VERSION[2]}', failing gofmt."
#fi
find_files() {
git ls-files | grep '\.go$'
}

View File

@@ -57,21 +57,13 @@ function consistent-imports() {
fi
}
# loop through directories in an attempt to scan each go package
for dir in `find . -maxdepth 5 -type d -not -path './old/*' -not -path './old' -not -path './tmp/*' -not -path './tmp' -not -path './.*' -not -path './vendor/*'`; do
match="$dir/*.go"
#echo "match is: $match"
if ! ls $match &>/dev/null; then
#echo "skipping: $match"
continue # no *.go files found
fi
#echo "matching: $match"
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3|go1.4|go1.5|go1.6|go1.7|go1.8') ]]; then
# run go vet on a per-package basis
base=$(go list .)
for pkg in `go list -e ./... | grep -v "^${base}/vendor/" | grep -v "^${base}/examples/" | grep -v "^${base}/test/" | grep -v "^${base}/old" | grep -v "^${base}/old/" | grep -v "^${base}/tmp" | grep -v "^${base}/tmp/"`; do
echo -e "\tgo vet: $pkg"
# workaround go vet issues by adding the new -source flag (go1.9+)
run-test go vet -source "$match" || fail_test "go vet -source did not pass pkg"
else
run-test go vet "$match" || fail_test "go vet did not pass pkg" # since it doesn't output an ok message on pass
fi
run-test go vet -source "$pkg" || fail_test "go vet -source did not pass pkg"
done
# loop through individual *.go files