Created
September 1, 2018 16:30
-
-
Save msoedov/f6dab8f84dd2a3c0dec1d692867495d9 to your computer and use it in GitHub Desktop.
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 characters
#!/bin/bash | |
# The script does automatic checking on a Go package and its sub-packages, including: | |
# 1. gofmt (http://golang.org/cmd/gofmt/) | |
# 2. go vet (http://golang.org/cmd/vet) | |
# 3. gosimple (https://github.com/dominikh/go-simple) | |
# 4. unconvert (https://github.com/mdempsky/unconvert) | |
# 5. ineffassign (https://github.com/gordonklaus/ineffassign) | |
# 6. race detector (http://blog.golang.org/race-detector) | |
# 7. test coverage (http://blog.golang.org/cover) | |
# gometaling (github.com/alecthomas/gometalinter) is used to run each each | |
# static checker. | |
set -ex | |
# Make sure gometalinter is installed and $GOPATH/bin is in your path. | |
# $ go get -v github.com/alecthomas/gometalinter" | |
# $ gometalinter --install" | |
if [ ! -x "$(type -p gometalinter)" ]; then | |
exit 1 | |
fi | |
# Automatic checks | |
test -z "$(gometalinter --vendor --disable-all \ | |
--enable=gofmt \ | |
--enable=vet \ | |
--enable=gosimple \ | |
--enable=unconvert \ | |
--enable=ineffassign \ | |
--deadline=10m ./... 2>&1 | tee /dev/stderr)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment