Skip to content

Commit f3a6061

Browse files
committed
ci(go): configure the go.yaml checks to ensure go code is properly formatted
1 parent 67cba20 commit f3a6061

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/go.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,15 @@ jobs:
5858
- name: Check if generated code is up to date
5959
run: bash .github/workflows/scripts/check-generated-go.sh
6060

61+
- name: Check gofmt
62+
run: |
63+
fmt_files=$(go fmt ./...)
64+
if [ -n "$fmt_files" ]; then
65+
echo "Go files are not formatted. Please run 'go fmt ./...' and commit the changes:"
66+
echo "$fmt_files"
67+
exit 1
68+
fi
69+
working-directory: ./go
70+
6171
- name: Run tests
6272
run: go test -C go -v ./...

0 commit comments

Comments
 (0)