What happened:
Having run make bootstrap-tools to install the requisite version of golangci-lint - 1.45.0 - into .tmp/golangci-lint other make commands lead to a panic from golangci-lint : -
panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
goroutine 1 [running]:
github.com/go-critic/go-critic/checkers.init.22()
github.com/go-critic/go-critic@v0.6.2/checkers/embedded_rules.go:46 +0x494
In fact, merely running .tmp/golangci-lint results in the same panic.
This is due to an issue with golangci-lint itself, as per this - go-critic/ruleguard: load embedded ruleguard rules: rules/rules.go:13: can't load fmt #3107 - and occurs with versions 1.45.0, 1.46.0 and 1.47.0.
Later versions from 1.48.0 through the current latest - 1.50.1 - work OK
What you expected to happen:
make etc. that leverages golangci-lint should run to completion; also golangci-lint commands such .tmp/golangci-lint --version should just work: -
golangci-lint has version 1.50.1 built from 8926a95f on 2022-10-22T10:50:47Z
How to reproduce it (as minimally and precisely as possible):
- Clone the sbom-cli-plugin repo
- Run
make bootstrap-tools
- Test the downloaded/installed version of
golangci-lint via .tmp/golangci-lint --version or just run make
- Watch the panic
Anything else we need to know?:
Environment:
go version
go version go1.19.4 darwin/arm64
sw_vers
ProductName: macOS
ProductVersion: 13.1
BuildVersion: 22C65
I've also reproduced the same on Ubuntu
I'll create a PR from my own fork, updating golangci-lint to the (current) latest - 1.50.1 - as per that project's releases page
What happened:
Having run
make bootstrap-toolsto install the requisite version ofgolangci-lint-1.45.0- into.tmp/golangci-lintother make commands lead to apanicfromgolangci-lint: -In fact, merely running
.tmp/golangci-lintresults in the same panic.This is due to an issue with
golangci-lintitself, as per this - go-critic/ruleguard: load embedded ruleguard rules: rules/rules.go:13: can't load fmt #3107 - and occurs with versions1.45.0,1.46.0and1.47.0.Later versions from
1.48.0through the current latest -1.50.1- work OKWhat you expected to happen:
makeetc. that leveragesgolangci-lintshould run to completion; alsogolangci-lintcommands such.tmp/golangci-lint --versionshould just work: -How to reproduce it (as minimally and precisely as possible):
make bootstrap-toolsgolangci-lintvia.tmp/golangci-lint --versionor just runmakeAnything else we need to know?:
Environment:
go versionsw_versI've also reproduced the same on Ubuntu
I'll create a PR from my own fork, updating
golangci-lintto the (current) latest -1.50.1- as per that project's releases page