gopherlint

module
v1.26.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: GPL-3.0

README

gopherlint

A stable, bugfix-only fork of golangci-lint.

Purpose

gopherlint exists for teams that want a linter that doesn't change between releases. golangci-lint is an excellent project that moves quickly — adding linters, improving defaults, and keeping pace with the Go ecosystem. This fork trades that freshness for predictability.

What changes: Only backported bugfixes from upstream, or original fixes for regressions. No new features, no linter additions or removals, no config-breaking changes.

What doesn't change: The linter set, configuration format, behavior, and CLI interface remain frozen for the life of a major version.

Based on

golangci-lint v2.10.1

Versioning

v1.GOMAJOR.PATCH
Segment Meaning
1 Fork major version — stable, no breaking changes
GOMAJOR Major Go version this release targets (e.g. 26 = Go 1.26)
PATCH Bugfix increment

Example: v1.26.0 is the first release targeting Go 1.26, based on golangci-lint v2.10.1.

Installation

curl -sSfL https://raw.githubusercontent.com/flimzy/gopherlint/main/install.sh | sh -s -- -b /usr/local/bin

To install a specific version:

curl -sSfL https://raw.githubusercontent.com/flimzy/gopherlint/main/install.sh | sh -s -- -b /usr/local/bin v1.26.1
Binary releases

Pre-built binaries are available on the Releases page. Download the archive for your platform, extract it, and place the gopherlint binary somewhere on your PATH.

Build from source
git clone https://github.com/flimzy/gopherlint.git
cd gopherlint
go build -o /usr/local/bin/gopherlint ./cmd/gopherlint

If your scripts or CI hardcode the name golangci-lint, a symlink works:

ln -s /usr/local/bin/gopherlint /usr/local/bin/golangci-lint
Why not go install?

go install module@version does not support modules with replace directives in go.mod. gopherlint vendors and patches upstream dependencies (like gosec) to backport bugfixes, which requires replace directives. This is fundamental to how the project works, so go install will not be supported. Use the install script or build from source instead.

Usage

gopherlint is a drop-in replacement for golangci-lint. It accepts the same flags and the same configuration format. The only difference is the binary name. Refer to the golangci-lint documentation — it applies directly to gopherlint (based on v2.10.1).

# Same config, same flags — just a different binary name
gopherlint run ./...

Existing .golangci.yml / .golangci.toml / .golangci.json config files work without modification.

GitHub Actions

The official golangci-lint action hardcodes the binary name golangci-lint, so it cannot invoke gopherlint directly. Two approaches are available.

Option A: run directly (simpler)
- name: Install gopherlint
  run: |
    curl -sSfL https://github.com/flimzy/gopherlint/releases/download/v1.26.0/gopherlint-v1.26.0-linux-amd64.tar.gz \
      | tar -xz --strip-components=1 -C /usr/local/bin gopherlint-v1.26.0-linux-amd64/gopherlint

- name: Run gopherlint
  run: gopherlint run ./...
Option B: use the official action (GitHub annotations)

Install gopherlint and expose it as golangci-lint so the official action can find and invoke it. This preserves inline PR annotations.

- name: Install gopherlint
  run: |
    curl -sSfL https://github.com/flimzy/gopherlint/releases/download/v1.26.0/gopherlint-v1.26.0-linux-amd64.tar.gz \
      | tar -xz --strip-components=1 -C /usr/local/bin gopherlint-v1.26.0-linux-amd64/gopherlint
    ln -s /usr/local/bin/gopherlint /usr/local/bin/golangci-lint

- name: Run gopherlint via golangci-lint action
  uses: golangci/golangci-lint-action@v6
  with:
    install-mode: none

New features and linters

This fork does not add new features or linters. For that, use golangci-lint directly.

License

GPL-3.0

Directories

Path Synopsis
cmd
gopherlint command
internal
go/cache
Package cache implements a build artifact cache.
Package cache implements a build artifact cache.
go/cacheprog
Package cacheprog defines the protocol for a GOCACHEPROG program.
Package cacheprog defines the protocol for a GOCACHEPROG program.
go/mmap
The mmap package provides an abstraction for memory mapping files on different platforms.
The mmap package provides an abstraction for memory mapping files on different platforms.
go/quoted
Package quoted provides string manipulation utilities.
Package quoted provides string manipulation utilities.
go/testenv
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
x/tools/analysisinternal
Package analysisinternal provides gopls' internal analyses with a number of helper functions that operate on typed syntax trees.
Package analysisinternal provides gopls' internal analyses with a number of helper functions that operate on typed syntax trees.
x/tools/diff
Package diff computes differences between text files or strings.
Package diff computes differences between text files or strings.
x/tools/diff/lcs
package lcs contains code to find longest-common-subsequences (and diffs)
package lcs contains code to find longest-common-subsequences (and diffs)
x/tools/diff/myers
Package myers implements the Myers diff algorithm.
Package myers implements the Myers diff algorithm.
pkg
commands/internal/migrate/versionone
Package versionone contains a modified copy of v1 configuration.
Package versionone contains a modified copy of v1 configuration.
goanalysis
Package goanalysis defines the implementation of the checker commands.
Package goanalysis defines the implementation of the checker commands.
golinters/nolintlint/internal
Package internal provides a linter to ensure that all //nolint directives are followed by explanations
Package internal provides a linter to ensure that all //nolint directives are followed by explanations
scripts
print_ast command
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL