move gofmt into a separate script

This commit is contained in:
Michael Kuzmin 2018-10-30 23:52:54 +03:00
parent 4dcd6c1f9d
commit 6bfb34e0ab
2 changed files with 15 additions and 14 deletions

14
gofmt.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
RETVAL=0
for file in $(find . -name '*.go' -not -path './vendor/*')
do
if [ -n "$(gofmt -l $file)" ]
then
echo "$file does not conform to gofmt rules. Run: gofmt -s -w $file" >&2
RETVAL=1
fi
done
exit $RETVAL

15
test.sh
View File

@ -4,17 +4,4 @@ set -eux
export PACKER_ACC=1
RETVAL=0
for file in $(find ./ -type f ! -path "./vendor/*" -name '*.go' -print)
do
if [[ -n "$(gofmt -l "$file")" ]]
then
echo -e "$file does not conform to gofmt rules. Run: gofmt -s -w $file"
RETVAL=1
fi
done
exit $RETVAL
go test -v -count 1 -timeout 20m ./driver ./iso ./clone
go test -v -count 1 -timeout 20m ./driver ./iso ./clone