Files
fn-serverless/go-fmt.sh
Owen Strain c36c627b93 Trivial fix to get 'make test' working on Mac (#749)
Apparently GNU find lets you omit the directory but BSD find does not.
2018-02-08 17:52:17 -08:00

12 lines
328 B
Bash
Executable File

#!/bin/bash
# find and output all Go files that are not correctly formatted
set -euo pipefail
# Find all .go files except those under vendor/ or .git, run gofmt -l on them
OUT=$(find . ! \( -path ./vendor -prune \) ! \( -path ./.git -prune \) -name '*.go' -exec gofmt -l {} +)
if [ -n "$OUT" ]; then
echo "$OUT"
exit 1
fi