irc-go/.check-gofmt.sh
Shivaram Lingamneni cd9cd8d55f add ircreader
2021-02-13 19:57:21 -05:00

13 lines
231 B
Bash
Executable file

#!/bin/bash
SOURCES="."
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