Skip to content

fix: fix main.go

fix: fix main.go #6

Workflow file for this run

name: Go Format Check
on:
push:
pull_request:
workflow_dispatch:
jobs:
gofmt:
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.22'
# - name: Install golangci-lint
# run: |
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1
# - name: Run golangci-lint
# run: golangci-lint run
- name: Check Go format
run: |
# First check if files can be parsed correctly
if ! go vet ./...; then
echo "❌ Go files contain syntax errors"
exit 1
fi
# Then check formatting
if [ -n "$(gofmt -l .)" ]; then
echo "❌ Go code is not formatted:"
gofmt -d .
exit 1
else
echo "✅ Go code is properly formatted"
fi