Skip to content

Commit 0fc1547

Browse files
committed
Fix CI formatting check
- Only check .go files with gofmt, not go.mod - Use gofmt -l for listing and -d for diff separately
1 parent 26f8898 commit 0fc1547

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ jobs:
6262

6363
- name: Check formatting
6464
run: |
65-
if ! gofmt -d . | grep -q .; then
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 is properly formatted"
68+
else
6669
echo "Code needs formatting"
67-
gofmt -d .
70+
gofmt -d *.go ./...
6871
exit 1
6972
fi
7073

0 commit comments

Comments
 (0)