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

9 lines
220 B
Bash

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