mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-22 10:14:07 +01:00
14 lines
231 B
Bash
14 lines
231 B
Bash
|
#!/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
|