Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run tests against go 1.11 and drop 1.9 (#737)
* Update the Travis and CircleCI Go versions * Adapt to new gofmt formatting The formatting of gofmt changed slightly in go 1.11. The release notes recommend to use a specific binary of gofmt. See https://golang.org/doc/go1.11#gofmt This commit adapts to the new formatting applied by gofmt and changes the configs for travis and circleci to run gofmt only with go 1.11.
- Loading branch information
Showing
3 changed files
with
49 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,53 @@ | ||
workflows: | ||
version: 2 | ||
main: | ||
jobs: | ||
- go-current | ||
- go-previous | ||
- go-latest | ||
base: &base | ||
working_directory: /go/src/github.com/spf13/cobra | ||
steps: | ||
- checkout | ||
- run: | ||
name: "All Commands" | ||
command: | | ||
mkdir -p bin | ||
curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/releases/download/v0.4.6/shellcheck | ||
chmod +x bin/shellcheck | ||
go get -t -v ./... | ||
PATH=$PATH:$PWD/bin go test -v ./... | ||
go build | ||
diff -u <(echo -n) <(gofmt -d -s .) | ||
if [ -z $NOVET ]; then | ||
diff -u <(echo -n) <(go tool vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint'); | ||
fi | ||
version: 2 | ||
|
||
references: | ||
workspace: &workspace | ||
/go/src/github.com/spf13/cobra | ||
|
||
run_tests: &run_tests | ||
run: | ||
name: "All Commands" | ||
command: | | ||
mkdir -p bin | ||
curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/releases/download/v0.4.6/shellcheck | ||
chmod +x bin/shellcheck | ||
go get -t -v ./... | ||
PATH=$PATH:$PWD/bin go test -v ./... | ||
go build | ||
if [ -z $NOVET ]; then | ||
diff -u <(echo -n) <(go tool vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint'); | ||
fi | ||
jobs: | ||
go-current: | ||
docker: | ||
- image: circleci/golang:1.10.0 | ||
<<: *base | ||
- image: circleci/golang:1.11 | ||
working_directory: *workspace | ||
steps: | ||
- checkout | ||
- *run_tests | ||
- run: | ||
name: "Check formatting" | ||
command: diff -u <(echo -n) <(gofmt -d -s .) | ||
go-previous: | ||
docker: | ||
- image: circleci/golang:1.9.4 | ||
<<: *base | ||
- image: circleci/golang:1.10 | ||
working_directory: *workspace | ||
steps: | ||
- checkout | ||
- *run_tests | ||
go-latest: | ||
docker: | ||
- image: circleci/golang:latest | ||
<<: *base | ||
working_directory: *workspace | ||
steps: | ||
- checkout | ||
- *run_tests | ||
|
||
workflows: | ||
version: 2 | ||
main: | ||
jobs: | ||
- go-current | ||
- go-previous | ||
- go-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters