mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
Newer versions of gofmt and govet will exit non-zero if they find any issues. This simply sets -e to ensure the scripts will also exit non-zero to properly trigger a build failure.
14 lines
230 B
Bash
Executable File
14 lines
230 B
Bash
Executable File
#!/bin/sh -e
|
|
|
|
# run go fmt and exit non-zero if it detected anything
|
|
T=$(mktemp -t gofmt.XXXXX)
|
|
go fmt ./... > $T
|
|
if egrep -q '.*' "$T" ; then
|
|
echo "go fmt failed on the following files:"
|
|
cat "$T"
|
|
rm $T
|
|
exit 1
|
|
fi
|
|
rm $T
|
|
exit 0
|