Closed PanKaker closed 1 year ago
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.
I've tried to use binary 1.51.1 version and this issues didn't appear. Looks like it's something connected with 1.51.2 version
Small update: Looks like this version was installed by Visual Studio code.
When I used binary (1.51.2) from the release page, I didn't face this issues
I'm closing the issue
Seeing the same issue here, where golangci-lint
's typecheck
linter fails, as it analyzes imported code - here: net/http
:
Using version 1.51.2
.
../../../../../nix/store/r53hy5fziwxx65487jdv8nci8xajqyds-go-1.20.1/share/go/src/runtime/debuglog.go:296:20: StringData not declared by package unsafe (typecheck)
strData := unsafe.StringData(x)
^
../../../../../nix/store/r53hy5fziwxx65487jdv8nci8xajqyds-go-1.20.1/share/go/src/runtime/heapdump.go:159:37: StringData not declared by package unsafe (typecheck)
dumpmemrange(unsafe.Pointer(unsafe.StringData(s)), uintptr(len(s)))
^
../../../../../nix/store/r53hy5fziwxx65487jdv8nci8xajqyds-go-1.20.1/share/go/src/runtime/heapdump.go:202:32: StringData not declared by package unsafe (typecheck)
dwrite(unsafe.Pointer(unsafe.StringData(pkgpath)), uintptr(len(pkgpath)))
^
../../../../../nix/store/r53hy5fziwxx65487jdv8nci8xajqyds-go-1.20.1/share/go/src/runtime/proc.go:658:16: String not declared by package unsafe (typecheck)
s := unsafe.String(p, findnull(p))
^
../../../../../nix/store/r53hy5fziwxx65487jdv8nci8xajqyds-go-1.20.1/share/go/src/runtime/string.go:105:17: String not declared by package unsafe (typecheck)
return unsafe.String((*byte)(p), 1)
^
../../../../../nix/store/r53hy5fziwxx65487jdv8nci8xajqyds-go-1.20.1/share/go/src/runtime/string.go:115:16: String not declared by package unsafe (typecheck)
return unsafe.String((*byte)(p), n)
[...]
@eliasp Did you try to install the latest version from the release page?
I think my problem was with VS Code: I changed the linter in VS Code settings, and it downloaded a strange version.
I've tried to download binary from the release page and these issues disappeared.
That's weird - it works with the one from the release page.
The version I used before is the one included in nixpkgs - it seems there were changes in golangci-lint
which have this effect on binaries built by 3rd parties.
I'll investigate further and try to get to the root of this.
Hello, it's not a problem with golangci-lint.
typecheck
is not a real linter it's just a way to parse/display "compilation" and linters errors (linter reports are not errors).
typecheck is not a real linter it's just a way to parse/display "compilation" and linters errors (linter reports are not errors).
I've seen you post this on other issues as well, but it's not a helpful response. I'm facing this error in my CI right now. It may not be a linter message, but it's definitely being emitted from golangci-lint.
My guess is that this is a problem of golangci-lint being built with a different (probably lower) version of Go than what is used to build the code it's linting.
Yeah, can confirm, I updated golangci-lint to be built with go1.20 (previously 1.18), and the repo I was linting was built with go1.20, and that fixed the problem.
I've seen you post this on other issues as well, but it's not a helpful response.
I added a suggested list to #3460 for things to try when troubleshooting find the root cause. Just to be clear did you just update the version of golangci-lint
or are you building your binary yourself and rebuilt it with go1.20 now?
Welcome
Description of the problem
Typecheck errors occurred when try to run command in my project dir:
golangci-lint run ./...
Version of golangci-lint
golangci-lint has version v1.51.2 built from (unknown, mod sum: "h1:yIcsT1X9ZYHdSpeWXRT1ORC/FPGSqDHbHsu9uk4FK7M=") on (unknown)
Configuration file
No config is used
Go environment
Verbose output of running
Code example or link to a public repository