name: Go Checks

on:
  push:
    branches:
      - 'master'
  pull_request:
    branches:
      - '**'

jobs:
  format-check:
    name: gofmt
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v5
      - name: Set up Go
        uses: actions/setup-go@v6
        with:
          go-version-file: go.mod
      - name: Run gofmt
        run: gofmt -l . | grep . && exit 1 || exit 0
