summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgolint.bash23
-rwxr-xr-xtest.bash2
2 files changed, 18 insertions, 7 deletions
diff --git a/golint.bash b/golint.bash
index 6da72c8..5040c12 100755
--- a/golint.bash
+++ b/golint.bash
@@ -1,7 +1,18 @@
-#!/bin/bash
+#!/bin/bash -u
-golint ./... | \
- grep -v "don't use an underscore in package name" | \
- grep -v "don't use ALL_CAPS in Go names; use CamelCase" |
- grep -v "struct field allow_other should be allowOther" |
- grep -v "struct field serialize_reads should be serializeReads"
+OUTPUT=$(
+ golint ./... | \
+ grep -v "don't use an underscore in package name" | \
+ grep -v "don't use ALL_CAPS in Go names; use CamelCase" |
+ grep -v "struct field allow_other should be allowOther" |
+ grep -v "struct field serialize_reads should be serializeReads"
+)
+
+# No output --> all good
+if [[ -z "$OUTPUT" ]] ; then
+ exit 0
+fi
+
+echo "golint.bash:"
+echo $OUTPUT
+exit 1
diff --git a/test.bash b/test.bash
index 405d3b2..32f77dc 100755
--- a/test.bash
+++ b/test.bash
@@ -33,7 +33,7 @@ fi
if go tool | grep vet > /dev/null ; then
go tool vet -all -shadow .
else
- echo "\"go tool vet\" not available - skipping"
+ echo "'go tool vet' not available - skipping"
fi
# We don't want all the subprocesses holding the lock file open