1
Fork 0
photoview/.husky/lint-api.sh

9 lines
220 B
Bash
Raw Normal View History

2021-04-03 17:49:18 +02:00
#!/bin/sh
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep --silent '.go$')
2021-04-03 17:49:18 +02:00
[ -z "$gofiles" ] && exit 0
# Automatically format go code, exit on error
echo "Formatting staged go files"
gofmt -w $gofiles