-
I’m encountering an issue running golangci-lint in one of my repositories. The linter fails with the following error:
What I’ve Tried: Configuration: I’m using a shared .golangci.yaml configuration and running the linter via GitHub Actions. Here’s a minimal version of my setup: .golangci.yamlversion: "2"
run:
tests: false
modules-download-mode: readonly
timeout: 10m
issues-exit-code: 1
linters:
default: fast
enable:
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- misspell
- gosec
- revive
- prealloc
settings:
errcheck:
check-type-assertions: true
misspell:
locale: US
formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
simplify: false
rewrite-rules:
- pattern: interface{}
replacement: any
- pattern: a[b:len(a)]
replacement: a[b:] GitHub Action Step- name: Run golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --verbose
config: .golangci.yaml
verify: true Environment:
Request for Help: I’m not sure how to resolve the "no export data" issue or how to properly exclude goanalysis_metalinter if it’s not explicitly declared in the config. Any insights into the cause of this error or suggestions for a workaround would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
The problem is related to your project, my guess is a problem with your go.mod/go.sum, or build tags.
|
Beta Was this translation helpful? Give feedback.
The module
github.com/containers/image/v5
depends ong.yxqyang.asia/containers/storage
, and this module (github.com/containers/storage
) uses cgo, so some system dependencies are required.btrfs
seems not available inside GitHub action environments.You should add the following lines inside your workflow file:
https://github.com/ldez/schlesh-golangci-lint-example/blob/cf91acb93957391f6557e3112d1ddf5c0521a74b/.github/workflows/go_lint.yaml#L12-L13