Debian Codegraph @

.githooks/pre-commit

raw
1 #!/usr/bin/env bash
2 # Fail on unformatted Go files
3 unformatted=$(gofmt -l . 2>/dev/null)
4 if [ -n "$unformatted" ]; then
5 echo "gofmt: these files are not formatted:"
6 echo "$unformatted"
7 exit 1
8 fi