packer-cn/gofmt.sh

15 lines
250 B
Bash
Raw Normal View History

2018-10-30 16:52:54 -04:00
#!/bin/sh
RETVAL=0
for file in $(find . -name '*.go' -not -path './vendor/*')
do
if [ -n "$(gofmt -l $file)" ]
then
echo "$file does not conform to gofmt rules. Run: gofmt -s -w $file" >&2
RETVAL=1
fi
done
exit $RETVAL