代码拉取完成,页面将自动刷新
#!/bin/sh
GOFMT_FILES=$(gofmt -l .)
if [ -n "${GOFMT_FILES}" ]; then
printf >&2 'gofmt failed for the following files:\n%s\n\nplease run "gofmt -w ." on your changes before committing.\n' "${GOFMT_FILES}"
exit 1
fi
GOLINT_ERRORS=$(golint ./... | grep -v "Id should be")
if [ -n "${GOLINT_ERRORS}" ]; then
printf >&2 'golint failed for the following reasons:\n%s\n\nplease run 'golint ./...' on your changes before committing.\n' "${GOLINT_ERRORS}"
exit 1
fi
GOVET_ERRORS=$(go tool vet *.go 2>&1)
if [ -n "${GOVET_ERRORS}" ]; then
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}"
exit 1
fi
if [ -z "${NOTEST}" ]; then
printf >&2 'Running short tests...\n'
env AMQP_URL= go test -short -v | egrep 'PASS|ok'
if [ $? -ne 0 ]; then
printf >&2 'go test failed, please fix before committing.\n'
exit 1
fi
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。