Check files with go fmt in CI

This commit is contained in:
Dan Sosedoff
2018-03-16 19:59:58 -05:00
parent d72f1c85c1
commit a02c813784
2 changed files with 14 additions and 0 deletions

13
script/check_formatting.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
files="$(go fmt ./...)"
ignore="pkg/data/bindata.go"
files=${files[@]/$ignore}
if [ -n "$files" ]; then
echo "Go code is not formatted: $files"
for file in $files; do
echo "----> $file"
done
exit 1
fi