From 1139d1d57b4f289aa5eca71554d985a598fe120b Mon Sep 17 00:00:00 2001 From: Jeffrey Regan Date: Wed, 25 Oct 2017 10:29:36 -0700 Subject: [PATCH] tweakprecommit --- bin/pre-commit.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/bin/pre-commit.sh b/bin/pre-commit.sh index 33731b0bf..8e3e11cd0 100755 --- a/bin/pre-commit.sh +++ b/bin/pre-commit.sh @@ -1,36 +1,36 @@ #!/bin/bash if [ -n "$failIt" ]; then - echo "Expecting failIt to be empty." + echo "Expecting failIt to be empty." exit 1 fi -tmp=$(gofmt -s -d -l . 2>&1 ) -if [ -n "$tmp" ]; then - printf >&2 'gofmt failed for:\n%s\n' "$tmp" - failIt=1 +wantEmpty=$(gofmt -s -d -l . 2>&1 ) +if [ -n "$wantEmpty" ]; then + printf >&2 'gofmt failed for:\n%s\n' "$wantEmpty" + failIt=1 fi -tmp=$(goimports -l .) -if [ -n "$tmp" ]; then - printf >&2 'goimports failed for:\n%s\n' "$tmp" - failIt=1 +wantEmpty=$(goimports -l .) +if [ -n "$wantEmpty" ]; then + printf >&2 'goimports failed for:\n%s\n' "$wantEmpty" + failIt=1 fi -tmp=$(go vet -all ./... 2>&1) -if [ -n "$tmp" ]; then - printf >&2 'govet failed for:\n%s\n' "$tmp" - failIt=1 +wantEmpty=$(go vet -all ./... 2>&1) +if [ -n "$wantEmpty" ]; then + printf >&2 'govet failed for:\n%s\n' "$wantEmpty" + failIt=1 fi -tmp=$(golint ./...) -if [ -n "$tmp" ]; then - printf >&2 'golint failed for:\n%s\n' "$tmp" - failIt=1 +wantEmpty=$(golint ./...) +if [ -n "$wantEmpty" ]; then + printf >&2 'golint failed for:\n%s\n' "$wantEmpty" + failIt=1 fi if [ -n "$failIt" ]; then - unset failIt + unset failIt exit 1 fi