Merge pull request #105 from monopole/beans

tweak precommit
This commit is contained in:
Jeff Regan 2017-10-25 11:08:41 -07:00 committed by GitHub
commit 1b8fe6c368
1 changed files with 18 additions and 18 deletions

View File

@ -1,36 +1,36 @@
#!/bin/bash #!/bin/bash
if [ -n "$failIt" ]; then if [ -n "$failIt" ]; then
echo "Expecting failIt to be empty." echo "Expecting failIt to be empty."
exit 1 exit 1
fi fi
tmp=$(gofmt -s -d -l . 2>&1 ) wantEmpty=$(gofmt -s -d -l . 2>&1 )
if [ -n "$tmp" ]; then if [ -n "$wantEmpty" ]; then
printf >&2 'gofmt failed for:\n%s\n' "$tmp" printf >&2 'gofmt failed for:\n%s\n' "$wantEmpty"
failIt=1 failIt=1
fi fi
tmp=$(goimports -l .) wantEmpty=$(goimports -l .)
if [ -n "$tmp" ]; then if [ -n "$wantEmpty" ]; then
printf >&2 'goimports failed for:\n%s\n' "$tmp" printf >&2 'goimports failed for:\n%s\n' "$wantEmpty"
failIt=1 failIt=1
fi fi
tmp=$(go vet -all ./... 2>&1) wantEmpty=$(go vet -all ./... 2>&1)
if [ -n "$tmp" ]; then if [ -n "$wantEmpty" ]; then
printf >&2 'govet failed for:\n%s\n' "$tmp" printf >&2 'govet failed for:\n%s\n' "$wantEmpty"
failIt=1 failIt=1
fi fi
tmp=$(golint ./...) wantEmpty=$(golint ./...)
if [ -n "$tmp" ]; then if [ -n "$wantEmpty" ]; then
printf >&2 'golint failed for:\n%s\n' "$tmp" printf >&2 'golint failed for:\n%s\n' "$wantEmpty"
failIt=1 failIt=1
fi fi
if [ -n "$failIt" ]; then if [ -n "$failIt" ]; then
unset failIt unset failIt
exit 1 exit 1
fi fi