Skip to content

Instantly share code, notes, and snippets.

@tbruyelle
Created June 13, 2017 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbruyelle/5f95a09d910a7dc06c5575dc7a5fd97b to your computer and use it in GitHub Desktop.
Save tbruyelle/5f95a09d910a7dc06c5575dc7a5fd97b to your computer and use it in GitHub Desktop.
checks:
go test -race $(TARGET)
@$(call checkbin,go tool vet,golang.org/x/tools/cms/vet)
go tool vet $(SRC_DIR)
@$(call checkbin,golint,github.com/golang/lint/golint)
golint -set_exit_status $(SRC_DIR)
@$(call checkbin,errcheck,github.com/kisielk/errcheck)
errcheck -ignore 'Close' -ignoretests $(TARGET)
@$(call checkbin,structcheck,github.com/opennota/check/cmd/structcheck)
structcheck $(TARGET)
@$(call checkbin,varcheck,github.com/opennota/check/cmd/varcheck)
varcheck $(TARGET)
@$(call checkbin,maligned,github.com/mdempsky/maligned)
maligned $(TARGET)
checkbin = $1 2> /dev/null; if [ $$? -eq 127 ]; then\
echo "Retrieving missing tool $2...";\
go get $2; \
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment