Using Github Actions with Golangci-linter

- go github golang

Github delivered a beta Github Actions, it’s a worflow that can run almost anything related to your code, like a CI/CD.

Here is a workflow for Go 1.13 module projects and golangci-lint.

name: golangci-lint
on: [push]

    name: Build
    runs-on: ubuntu-latest

    - name: Set up Go 1.13
      uses: actions/setup-go@v1
        go-version: 1.13
      id: go

    - name: Check out code into the Go module directory
      uses: actions/checkout@v1

    - name: Install golangci-lint
      run: curl -sfL| sh -s -- -b $(go env GOPATH)/bin v1.18.0

    - name: Run golangci-lint
      run: $(go env GOPATH)/bin/golangci-lint run

This file should be placed in your repo under .github/workflows/golangci-lint.yml but the action web editor will do it for you.

And the usual badge you can put in your

[![Lint Status](](

Also remember you can tune golangci-lint by placing a file at the root of your repo like:

 # default concurrency is a available CPU number
 concurrency: 4

 # timeout for analysis, e.g. 30s, 5m, default is 1m
 deadline: 2m

   - gen.go

     # modules-download-mode: vendor

   - errcheck
   - gochecknoglobals
   - dupl
   - bugs
   - unused
   - complexity
   - style

Note: The worflow name part of the badge url is case sensitive ;)