diff --git a/scripts/test.sh b/scripts/test.sh index 1037381..ccc0ab3 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -FMT="*.go" - echo "Running tests..." go test -v -cover -cpu 1,2,4 ./... go test -v -cover -cpu 1,2,4 -race ./... echo "Checking gofmt..." -fmt_res=$(gofmt -l -s $FMT) +# We utilize 'go fmt' to find all files suitable for formatting, +# but reuse full power gofmt to perform just RO check. +fmt_res=$(go fmt -n ./... | sed 's| -w | -d |g' | sh) if [ -n "${fmt_res}" ]; then echo -e "gofmt checking failed:\n${fmt_res}" exit 1