From c509b73accdc83229b8cb6453d3b78e2b2cb800e Mon Sep 17 00:00:00 2001 From: Michael Sauter Date: Mon, 28 Mar 2022 11:10:57 +0200 Subject: [PATCH] Run go fmt over packages, not entire directory Otherwise the now persistent Go mod cache is checked as well, and builds will fail if any dependency is not gofmt'd. Fixes #484. --- build/package/scripts/build-go.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/package/scripts/build-go.sh b/build/package/scripts/build-go.sh index 1a7647f3..9ec4af7e 100755 --- a/build/package/scripts/build-go.sh +++ b/build/package/scripts/build-go.sh @@ -71,7 +71,7 @@ echo GOMODCACHE="$GOMODCACHE" df -h "$ROOT_DIR" echo "Checking format ..." -unformatted=$(gofmt -l .) +unformatted=$(go fmt $(go list ./...)) if [ -n "${unformatted}" ]; then echo "Unformatted files:" echo "${unformatted}"