refactor: apply Google Go style guide improvements across codebase #124
This file contains hidden or 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 CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run unit tests | |
| run: make test | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Read golangci-lint version from .golangci.version | |
| id: golangci-version | |
| run: echo "GOLANGCI_VERSION=$(cat .golangci.version)" > $GITHUB_OUTPUT | |
| - uses: golangci/golangci-lint-action@v8 | |
| name: Install and run golangci-lint | |
| with: | |
| version: v${{ steps.golangci-version.outputs.GOLANGCI_VERSION }} | |
| args: -h | |
| - run: make lint | |
| name: Lint |