mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-27 10:14:01 -04:00
add gofmt to test.sh, the script exit 1 if one go files doesn't respect gofmt rules
20 lines
353 B
Bash
Executable File
20 lines
353 B
Bash
Executable File
#!/bin/sh
|
|
|
|
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 |