mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 11:24:44 -07:00
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.
14 lines
227 B
Bash
Executable File
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
|