Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update golangci-lint to latest - 1.50.1 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidhay1969
Copy link

To resolve "can't load fmt" error, seen when running: -

.tmp/bin/golangci-lint --version

etc.

Signed-off-by: Dave Hay david_hay@uk.ibm.com

Additional details

With default 1.47.2 included with go-bouncer

make bootstrap

Downloading dependencies
# prep temp dirs
mkdir -p ./.tmp
mkdir -p ./.tmp/results
mkdir -p /root/go/src/github.com/wagoodman/go-bouncer/.tmp/bin
# download install project dependencies + tooling
go mod download
cat tools.go | grep _ | awk -F'"' '{print $2}' | xargs -tI % env GOBIN=/root/go/src/github.com/wagoodman/go-bouncer/.tmp/bin go install %
env 'GOBIN=/root/go/src/github.com/wagoodman/go-bouncer/.tmp/bin' go install github.com/google/licenseclassifier/tools/license_serializer
# install golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /root/go/src/github.com/wagoodman/go-bouncer/.tmp/bin v1.47.2
golangci/golangci-lint info checking GitHub for tag 'v1.47.2'
golangci/golangci-lint info found version: 1.47.2 for v1.47.2/linux/amd64
golangci/golangci-lint info installed /root/go/src/github.com/wagoodman/go-bouncer/.tmp/bin/golangci-lint
# install pkger
cd ./.tmp && curl -sLO https://github.com/markbates/pkger/releases/download/v0.17.0/pkger_0.17.0_Linux_x86_64.tar.gz && \
	tar -xzvf pkger_0.17.0_Linux_x86_64.tar.gz pkger && \
	mv pkger /root/go/src/github.com/wagoodman/go-bouncer/.tmp/bin
pkger
# install goreleaser
GOBIN=/root/go/src/github.com/wagoodman/go-bouncer/.tmp/bin go install github.com/goreleaser/goreleaser@v1.3.1

make

Running linters
files with gofmt issues: []
/root/go/src/github.com/wagoodman/go-bouncer/.tmp/bin/golangci-lint run --tests=false --config .golangci.yaml
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.3/checkers/embedded_rules.go:47 +0x4b4
make: *** [Makefile:75: lint] Error 2

ls -al .tmp/bin/golangci-lint

-rwxr-xr-x 1 root root 23461888 Dec  2 09:33 .tmp/bin/golangci-lint

.tmp/bin/golangci-lint --version

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.3/checkers/embedded_rules.go:47 +0x4b4

Match other known issues with older versions of golangci-lint such as Panic since update to v1.43.0 (load embedded ruleguard rules: rules/rules.go:13: can't load fmt) #2374 and go-critic/ruleguard: load embedded ruleguard rules: rules/rules.go:13: can't load fmt #3107

With current latest 1.50.1 - as per golangci-lint/releases

.tmp/bin/golangci-lint --version

golangci-lint has version 1.50.1 built from 8926a95f on 2022-10-22T10:50:47Z

ls -al .tmp/bin/golangci-lint

-rwxr-xr-x 1 root root 24383488 Dec  2 09:38 .tmp/bin/golangci-lint

( having run make bootstrap )

To resolve "can't load fmt" error, seen when running: -

.tmp/bin/golangci-lint --version

etc.

Signed-off-by: Dave Hay <david_hay@uk.ibm.com>
@davidhay1969
Copy link
Author

Apologies, forgot to mention that I'm running go version go1.19.3 linux/amd64 on Ubuntu 20.04.5 LTS with kernel 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

@davidhay1969
Copy link
Author

Hi @wagoodman wasn't sure whether you'd seen this PR ? If I'm misunderstanding the way that golangci-lint is being installed, apologies 😿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant