code.flowtr.dev/mirrors/u-root@v1.0.0/scripts/pre-commit (about) 1 #!/bin/bash 2 3 set -e 4 5 echo "Running Pre-Commit" 6 7 FILES=`git diff --staged --name-only | grep '.*\.go' | cat` 8 9 if [ -z "$FILES" ]; 10 then 11 echo "No go files to check. Skipping." 12 exit 0 13 fi 14 15 gofmt -w -s $FILES 16 golint -set_exit_status $FILES 17 go tool vet cmds pkg 18 go tool vet u-root.go 19 20 echo "Pre-Commit Passed"