We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b6c557 commit 3aac375Copy full SHA for 3aac375
1 file changed
.github/workflows/ci.yml
@@ -62,9 +62,10 @@ jobs:
62
63
- name: Check formatting
64
run: |
65
- # Only check .go files, not go.mod or other config files
66
- if ! gofmt -l *.go ./... 2>/dev/null | grep -q .; then
67
- echo "Code needs formatting"
68
- gofmt -d *.go ./...
+ # Only check .go files
+ unformatted=$(gofmt -l *.go)
+ if [ -n "$unformatted" ]; then
+ echo "Code needs formatting:"
69
+ gofmt -d *.go
70
exit 1
71
fi
0 commit comments