diff options
author | Toshiaki Takahashi <takahashi.tsc@ncos.nec.co.jp> | 2018-09-06 09:04:29 +0000 |
---|---|---|
committer | Toshiaki Takahashi <takahashi.tsc@ncos.nec.co.jp> | 2018-09-07 06:03:01 +0000 |
commit | d61931341176dad9ccff7c967a10d88fe54218fa (patch) | |
tree | 526457882d4abe0c38d2242d6daa311bf8ef51cf /src/dma/vendor/github.com/streadway/amqp/pre-commit | |
parent | 73abc060f31a6bf866fa1dad0a1a6efdfd94d775 (diff) |
src: Add DMA localagent
Change-Id: Ibcee814fbc9a904448eeb368a1a26bbb69cf54aa
Signed-off-by: Toshiaki Takahashi <takahashi.tsc@ncos.nec.co.jp>
Diffstat (limited to 'src/dma/vendor/github.com/streadway/amqp/pre-commit')
-rwxr-xr-x | src/dma/vendor/github.com/streadway/amqp/pre-commit | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/dma/vendor/github.com/streadway/amqp/pre-commit b/src/dma/vendor/github.com/streadway/amqp/pre-commit new file mode 100755 index 00000000..7607f467 --- /dev/null +++ b/src/dma/vendor/github.com/streadway/amqp/pre-commit @@ -0,0 +1,29 @@ +#!/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 |