3 GOFMT_FILES=$(gofmt -l .)
4 if [ -n "${GOFMT_FILES}" ]; then
5 printf >&2 'gofmt failed for the following files:\n%s\n\nplease run "gofmt -w ." on your changes before committing.\n' "${GOFMT_FILES}"
9 GOLINT_ERRORS=$(golint ./... | grep -v "Id should be")
10 if [ -n "${GOLINT_ERRORS}" ]; then
11 printf >&2 'golint failed for the following reasons:\n%s\n\nplease run 'golint ./...' on your changes before committing.\n' "${GOLINT_ERRORS}"
15 GOVET_ERRORS=$(go tool vet *.go 2>&1)
16 if [ -n "${GOVET_ERRORS}" ]; then
17 printf >&2 'go vet failed for the following reasons:\n%s\n\nplease run "go tool vet *.go" on your changes before committing.\n' "${GOVET_ERRORS}"
21 if [ -z "${NOTEST}" ]; then
22 printf >&2 'Running short tests...\n'
23 env AMQP_URL= go test -short -v | egrep 'PASS|ok'
26 printf >&2 'go test failed, please fix before committing.\n'