File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6262 - name : Get dependencies
6363 run : go mod download
6464
65+ - name : Auto-format code
66+ run : |
67+ # Auto-format all Go files
68+ gofmt -s -w .
69+
70+ # Check if any files were formatted
71+ if [ -n "$(git status --porcelain 2>/dev/null)" ]; then
72+ echo "Some files were auto-formatted in the build process."
73+ git diff --name-only
74+ fi
75+
6576 - name : Run tests
6677 run : go test -v ./...
6778
Original file line number Diff line number Diff line change 4545
4646 - name : Run go fmt
4747 run : |
48+ # Auto-format all Go files
49+ gofmt -s -w .
50+
51+ # Check if any files were formatted (would indicate pre-existing formatting issues)
52+ if [ -n "$(git status --porcelain 2>/dev/null)" ]; then
53+ echo "Some files were auto-formatted. Consider running 'gofmt -s -w .' locally before committing."
54+ git diff --name-only
55+ fi
56+
57+ # Final check to ensure all files are properly formatted
4858 if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
49- echo "The following files are not formatted:"
59+ echo "The following files are still not formatted after auto-format :"
5060 gofmt -s -l .
5161 exit 1
5262 fi
You can’t perform that action at this time.
0 commit comments