name: Test Go on: pull_request: types: [opened, synchronize, reopened] jobs: test: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v5 with: go-version: '1.21' - name: Run tests run: go test -v ./... - name: Run vet run: go vet ./... - name: Run fmt check run: | if [ -n "$(gofmt -l .)" ]; then echo "Go code is not formatted:" gofmt -d . exit 1 fi