3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-11 14:39:31 +01:00
ergo/.check-gofmt.sh
Shivaram Lingamneni 70a6ea375c add make gofmt
2020-06-17 02:15:05 -04:00

15 lines
266 B
Bash
Executable File

#!/bin/bash
# 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
exit 1
fi