Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork178
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
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:falsemodules-download-mode:readonlytimeout:10missues-exit-code:1linters:default:fastenable: -errcheck -govet -ineffassign -staticcheck -unused -misspell -gosec -revive -preallocsettings:errcheck:check-type-assertions:truemisspell:locale:USformatters:enable: -gofmt -goimportssettings:gofmt:simplify:falserewrite-rules: -pattern:interface{}replacement:any -pattern:a[b:len(a)]replacement:a[b:] GitHub Action Step-name:Run golangci-lintuses:golangci/golangci-lint-action@v8with:version:latestargs:--verboseconfig:.golangci.yamlverify: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. |
BetaWas this translation helpful?Give feedback.
All reactions
The modulegithub.com/containers/image/v5 depends ongithub.com/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:
jobs:lint:runs-on:ubuntu-latestenv:# <-----CGO_ENABLED:0# <-----
Replies: 1 comment 10 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
The problem is related to your project, my guess is a problem with your go.mod/go.sum, or build tags.
|
BetaWas this translation helpful?Give feedback.
All reactions
-
Do you have a minimum reproducible example? If not, this is a sign that the problem is how your project environment is set up inside your CI. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Sorry for the delay. I put together this repo to demonstrate and was able to reproduce the issue. https://github.com/schlesh/golangci-lint-example |
BetaWas this translation helpful?Give feedback.
All reactions
👀 2
-
https://github.com/ldez/schlesh-golangci-lint-example/actions/runs/15173489891/job/42668950150 |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
The module
You should add the following lines inside your workflow file: jobs:lint:runs-on:ubuntu-latestenv:# <-----CGO_ENABLED:0# <----- |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thank you will report back with results. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
another possibility is to install steps: -name:install CGO dependenciesrun:sudo apt-get install libbtrfs-dev -y $docker run --rm -v$(pwd):/app -w /app -it golang:1.24 bashroot@c62dcb2bdc90:/app#go mod downloadroot@c62dcb2bdc90:/app#go run.#github.com/containers/storage/drivers/btrfs/go/pkg/mod/github.com/containers/storage@v1.58.0/drivers/btrfs/version.go:6:10: fatal error: btrfs/version.h: No such file or directory 6 | #include <btrfs/version.h> | ^~~~~~~~~~~~~~~~~compilation terminated.root@c62dcb2bdc90:/app#apt update&& apt -y upgrade...root@c62dcb2bdc90:/app#apt-get install libbtrfs-dev -yReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneThe following additional packages will be installed: libbtrfs0The following NEW packages will be installed: libbtrfs-dev libbtrfs00 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.Need to get 106 kB of archives.After this operation, 325 kB of additional disk space will be used.Get:1 http://deb.debian.org/debian bookworm/main amd64 libbtrfs0 amd64 6.2-1+deb12u1 [35.2 kB]Get:2 http://deb.debian.org/debian bookworm/main amd64 libbtrfs-dev amd64 6.2-1+deb12u1 [70.7 kB]Fetched 106 kB in 0s (3131 kB/s)debconf: delaying package configuration, since apt-utils is not installedSelecting previously unselected package libbtrfs0:amd64.(Reading database ... 15609 files and directories currently installed.)Preparing to unpack .../libbtrfs0_6.2-1+deb12u1_amd64.deb ...Unpacking libbtrfs0:amd64 (6.2-1+deb12u1) ...Selecting previously unselected package libbtrfs-dev:amd64.Preparing to unpack .../libbtrfs-dev_6.2-1+deb12u1_amd64.deb ...Unpacking libbtrfs-dev:amd64 (6.2-1+deb12u1) ...Setting up libbtrfs0:amd64 (6.2-1+deb12u1) ...Setting up libbtrfs-dev:amd64 (6.2-1+deb12u1) ...Processing triggers for libc-bin (2.36-9+deb12u10) ...root@c62dcb2bdc90:/app#go run.Parsed image transport: dockerroot@c62dcb2bdc90:/app# |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thank you the solution above worked like a charm. I'll go back and check the secondary solution in a bit and report back. @ldez you're the GOAT. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
I hope you enjoyed my work, Please consider donating or asking your company to do so. |
BetaWas this translation helpful?Give feedback.