Skip to content

Commit

Permalink
Run go fmt over packages, not entire directory
Browse files Browse the repository at this point in the history
Otherwise the now persistent Go mod cache is checked as well, and builds
will fail if any dependency is not gofmt'd.

Fixes #484.
  • Loading branch information
michaelsauter committed Mar 28, 2022
1 parent cb22dae commit c509b73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/package/scripts/build-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit c509b73

Please sign in to comment.