Files
nats-server/travis/govet.sh
Ken Robertson dacf0e033a Fix Travis to properly fail the build on go fmt and go vet.
When running go fmt/vet, they do not exit non-zero if they detect any issues,
they only print out information. This wraps go fmt/vet in a script that
captures the output to a temp file and checks if anything was written to it.
If any was, it prints it out then exits 1.
2014-08-12 23:03:38 -07:00

14 lines
227 B
Bash
Executable File

#!/bin/sh
# run go vet and exit non-zero if it detected anything
T=$(mktemp -t govet.XXXXX)
go vet ./... > $T
if egrep -q '.*' "$T" ; then
echo "go vet failed on the following files:"
cat "$T"
rm $T
exit 1
fi
rm $T
exit 0