golangci-lint "level=error msg='Running error'" - Fix in CI
golangci-lint did not just report findings - a linter failed to run. A Running error means the code did not typecheck, a sub-linter crashed, or the config/tool setup is wrong, so the run aborts before producing normal results.
What this error means
golangci-lint exits nonzero with a level=error msg="Running error" line, often citing a typecheck failure or a linter that could not load the packages. This is distinct from ordinary lint findings - the run itself broke.
level=error msg="Running error: context loading failed: failed to load packages:
internal/api/client.go:9:2: could not import github.com/org/missing (...)"
level=error msg="Running error: buildir: analysis skipped: errors in package"Common causes
The code does not typecheck
Many linters need to load and typecheck packages. A build/import error (a missing dependency, a compile error) makes that load fail, so the linter cannot run.
A missing dependency or wrong working directory
If modules are not downloaded or the lint runs from the wrong directory, package loading fails with a running error.
A misconfigured linter or version mismatch
A .golangci.yml referencing an unknown linter, or a golangci-lint version incompatible with the Go toolchain, can abort the run.
How to fix it
Make the code build first
A clean build (and downloaded modules) is a prerequisite for linting - fix compile/import errors before linting.
go mod download
go build ./... # must pass before lint can load packages
golangci-lint run ./...Align golangci-lint with your toolchain
- Pin a golangci-lint version compatible with your Go version.
- Validate the config with
golangci-lint config verify(orgolangci-lint linters). - Run from the module root so package loading succeeds.
How to prevent it
- Ensure
go build ./...passes before the lint step runs. - Pin compatible golangci-lint and Go versions in CI.
- Validate
.golangci.ymlso unknown linters do not abort the run.