-
-
Save grisu48/251f71721380722cac0a9fa615a1e3d7 to your computer and use it in GitHub Desktop.
Revisions
-
ryboe revised this gist
Mar 31, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ env: - GO111MODULE=on - GOFLAGS='-mod vendor' # You don't need to test on very old versions of the Go compiler. It's the user's # responsibility to keep their compiler up to date. go: - 1.12.x -
ryboe revised this gist
Mar 31, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,8 @@ dist: xenial language: go # Force-enable Go modules. Also force go to use the code in vendor/ # These will both be unnecessary when Go 1.13 lands. env: - GO111MODULE=on - GOFLAGS='-mod vendor' -
ryboe revised this gist
Mar 31, 2019 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,17 @@ # use the latest ubuntu environment (18.04) available on travis dist: xenial language: go # Force-enable Go modules. This will be unnecessary when Go 1.13 lands. env: - GO111MODULE=on - GOFLAGS='-mod vendor' # You don't need to test on very old version of the Go compiler. It's the user's # responsibility to keep their compilers up to date. go: - 1.12.x # Only clone the most recent commit. git: @@ -29,7 +29,7 @@ notifications: # build and immediately stop. It's sorta like having set -e enabled in bash. # Make sure golangci-lint is vendored. before_script: - go install github.com/golangci/golangci-lint/cmd/golangci-lint # script always runs to completion (set +e). If we have linter issues AND a # failing test, we want to see both. Configure golangci-lint with a -
Ryan Boehning revised this gist
Oct 19, 2018 . 1 changed file with 9 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,12 +4,14 @@ sudo: false language: go # Force-enable Go modules. This will be unnecessary when Go 1.12 lands. env: - GO111MODULE=on # You don't need to test on very old version of the Go compiler. It's the user's # responsibility to keep their compilers up to date. go: - 1.11.x # Only clone the most recent commit. git: @@ -25,12 +27,9 @@ notifications: # Anything in before_script that returns a nonzero exit code will flunk the # build and immediately stop. It's sorta like having set -e enabled in bash. # Make sure golangci-lint is vendored. before_script: - go install -mod vendor github.com/golangci/golangci-lint/cmd/golangci-lint # script always runs to completion (set +e). If we have linter issues AND a # failing test, we want to see both. Configure golangci-lint with a -
Ryan Boehning revised this gist
May 28, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,10 @@ go: - 1.9.x - 1.x # Only clone the most recent commit. git: depth: 1 # Skip the install step. Don't `go get` dependencies. Only build with the code # in vendor/ install: true -
Ryan Boehning revised this gist
May 28, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ # This is a weird way of telling Travis to use the fast container-based test # runner instead of the slow VM-based runner. sudo: false language: go # Only the last two Go releases are supported by the Go team with security -
Ryan Boehning revised this gist
May 27, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,10 @@ notifications: # Anything in before_script that returns a nonzero exit code will flunk the # build and immediately stop. It's sorta like having set -e enabled in bash. # Make sure golangci-lint is vendored by running # dep ensure -add github.com/golangci/golangci-lint/cmd/golangci-lint # ...and adding this to your Gopkg.toml file. # required = ["github.com/golangci/golangci-lint/cmd/golangci-lint"] before_script: - go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint -
Ryan Boehning revised this gist
May 27, 2018 . 1 changed file with 14 additions and 32 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,46 +1,28 @@ language: go # Only the last two Go releases are supported by the Go team with security # updates. Any older versions be considered deprecated. Don't bother testing # with them. go: - 1.9.x - 1.x # Skip the install step. Don't `go get` dependencies. Only build with the code # in vendor/ install: true # Don't email me the results of the test runs. notifications: email: false # Anything in before_script that returns a nonzero exit code will flunk the # build and immediately stop. It's sorta like having set -e enabled in bash. before_script: - go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint # script always runs to completion (set +e). If we have linter issues AND a # failing test, we want to see both. Configure golangci-lint with a # .golangci.yml file at the top level of your repo. script: - golangci-lint run # run a bunch of code checkers/linters in parallel - go test -v -race ./... # Run all the tests with the race detector enabled -
Ryan Boehning revised this gist
Nov 26, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ language: go # are allowed to fail on Go tip. go: - 1.9 - master # Skip the install step. Don't `go get` dependencies. Only build with the # code in vendor/ @@ -17,7 +17,7 @@ install: true matrix: # It's ok if our code fails on unstable development versions of Go. allow_failures: - go: master # Don't wait for tip tests to finish. Mark the test run green if the # tests pass on the stable versions of Go. fast_finish: true -
Ryan Boehning revised this gist
Oct 13, 2017 . 1 changed file with 12 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,7 @@ language: go # in the next version of Go. Don't worry! Later we declare that test runs # are allowed to fail on Go tip. go: - 1.9 - tip # Skip the install step. Don't `go get` dependencies. Only build with the @@ -27,20 +26,21 @@ matrix: notifications: email: false # Anything in before_script that returns a nonzero exit code will # flunk the build and immediately stop. It's sorta like having # set -e enabled in bash. before_script: - GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/ - go get github.com/golang/lint/golint # Linter - go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter - go get github.com/fzipp/gocyclo # script always run to completion (set +e). All of these code checks are must haves # in a modern Go project. script: - test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt - go test -v -race ./... # Run all the tests with the race detector enabled - go vet ./... # go vet is the official Go static analyzer - megacheck ./... # "go vet on steroids" + linter - gocyclo -over 19 $GO_FILES # forbid code with huge functions - golint -set_exit_status $(go list ./...) # one last linter -
Ryan Boehning created this gist
Jul 3, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ language: go # Only the last two Go releases are supported by the Go team with security # updates. Any versions older than that should be considered deprecated. # Don't bother testing with them. tip builds your code with the latest # development version of Go. This can warn you that your code will break # in the next version of Go. Don't worry! Later we declare that test runs # are allowed to fail on Go tip. go: - 1.7 - 1.8 - tip # Skip the install step. Don't `go get` dependencies. Only build with the # code in vendor/ install: true matrix: # It's ok if our code fails on unstable development versions of Go. allow_failures: - go: tip # Don't wait for tip tests to finish. Mark the test run green if the # tests pass on the stable versions of Go. fast_finish: true # Don't email me the results of the test runs. notifications: email: false # Anything in before_script: that returns a nonzero exit code will # flunk the build and immediately stop. It's sorta like having # set -e enabled in bash. before_script: - GO_FILES=$(find . -iname '*.go' | grep -v /vendor/) # All the .go files, excluding vendor/ - PKGS=$(go list ./... | grep -v /vendor/) # All the import paths, excluding vendor/ - go get github.com/golang/lint/golint # Linter - go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter # script always run to completion (set +e). All of these code checks are must haves # in a modern Go project. script: - test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt - go test -v -race $PKGS # Run all the tests with the race detector enabled - go vet $PKGS # go vet is the official Go static analyzer - megacheck $PKGS # "go vet on steroids" + linter - golint -set_exit_status $PKGS # one last linter