No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-04-14 00:51:16 +02:00
.github/workflows chore: update example 2025-04-14 00:51:16 +02:00
.plugins chore: add plugins folder 2023-06-12 19:10:09 +02:00
.gitignore chore: add plugins folder 2023-06-12 19:10:09 +02:00
.golangci.yml chore: update example 2025-04-14 00:51:16 +02:00
go.mod chore: update example 2025-04-14 00:51:16 +02:00
main.go feat: example Go application 2023-06-12 19:10:09 +02:00
main_test.go feat: example Go application 2023-06-12 19:10:09 +02:00
readme.md chore: update example 2025-04-14 00:51:16 +02:00

Golangci-lint-action and Plugins Example

This repository is an example to explain how to use custom linters (plugins) with the GitHub Action of golangci-lint.

Build and Install Plugins

      - name: Build and install plugins
        run: |
          git clone https://github.com/golangci/example-plugin-linter.git
          cd example-plugin-linter
          go build -o '${{ github.workspace }}/.plugins/example.so' -buildmode=plugin plugin/example.go
        working-directory: ${{ runner.temp }}
        env:
          CGO_ENABLED: 1

Install and Run golangci-lint

      - name: golangci-lint
        uses: golangci/golangci-lint-action@v7
        with:
          version: v2.1.1
          # The installation mode `goinstall` always uses `CGO_ENABLED=1`.
          install-mode: goinstall

Full Example

The Workflow.