add make gofmt

This commit is contained in:
Shivaram Lingamneni 2020-06-17 02:14:23 -04:00
parent 114e359347
commit 70a6ea375c
2 changed files with 8 additions and 1 deletions

View file

@ -3,6 +3,10 @@
# exclude vendor/
SOURCES="./oragono.go ./irc"
if [ "$1" = "--fix" ]; then
exec gofmt -s -w $SOURCES
fi
if [ -n "$(gofmt -s -l $SOURCES)" ]; then
echo "Go code is not formatted correctly with \`gofmt -s\`:"
gofmt -s -d $SOURCES