3
0
mirror of https://github.com/ergochat/ergo.git synced 2025-02-12 11:40:40 +01:00
2025-01-13 21:47:21 -05:00

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