tool/fmtck: gofmt err exit wrapper

The go devs in their infinite wisdom have decided that extending gofmt /
go fmt to error on exit is simply too complicated, so we have to script
away their inadequacies for them.
This commit is contained in:
Paul Stemmet 2022-12-09 16:26:22 +00:00
parent 5fceb121c9
commit 0049df847d
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
1 changed files with 8 additions and 0 deletions

8
tool/fmtck.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
if test -n "$(gofmt -l "$@")";
then
echo "[ERROR]: gofmt check errors"
gofmt -l "$@" | xargs -n1 printf ' > %s\n'
exit 1
fi