Replication of Future Sequences & Rounds #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Format Check | |
on: | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: read | |
jobs: | |
format: | |
name: Check Go Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23' | |
- name: Check Go Fmt | |
run: | | |
UNFORMATTED=$(gofmt -l .) | |
# If any files would be changed by gofmt, fail the check | |
if [ -n "$UNFORMATTED" ]; then | |
echo "The following files are not formatted properly:" | |
echo "$UNFORMATTED" | |
echo "Please run 'go fmt ./...' to format your code." | |
exit 1 | |
fi | |
echo "All Go files are properly formatted." |