mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
pre-commit: Check gofmt output for errors
gofmt doesn't return an error exit code when it fails (because some files are improperly formatted). Make sure that the output is empty instead.
This commit is contained in:
@@ -15,7 +15,7 @@ go_dirs() {
|
||||
}
|
||||
|
||||
echo "Running go fmt"
|
||||
go_dirs | xargs -0 gofmt -s -d -l
|
||||
diff <(echo -n) <(go_dirs | xargs -0 gofmt -s -d -l)
|
||||
rc=$((rc || $?))
|
||||
|
||||
echo "Running goimports"
|
||||
|
||||
Reference in New Issue
Block a user