-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
could not run linter xxx:buildssa: analysis skipped: errors in package: xxx could not import xxx #896
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
Comments
Seems like related to #885 |
@ydcool please check latest version, issue should be fixed |
@ernado thank you, I'll try it out soon. |
I'm having the same issue.
I'm running the latest version available in brew:
With Go 1.13:
|
I also have this problem |
I have the same error
|
I am having the same issue. Any updates? I am using golangci-lint v1.23.6 and go 1.13. |
I had the same issue with v1.23.3 after my Go is upgraded from 1.13 to 1.14. |
The same issue here:
|
Same here:
Cache clean did not help. The "undeclared name" ForStoringCustomerEvents is an interface in the same package. |
I solve this issue running this command before run the 'go list' needs to be executed before staticcheck to pre populate the modules cache. |
i am getting same error for v1.24.0 as well. Any pointers? |
@gaurav-dalvi can you please provide a log? |
@ernado :
|
things are passin for me now with 1.23.8 but for sure 1.24.0 was giving above problem |
I'm using I'm running mkdir example && cd example && go mod init example.com/pkg/example
touch main.go
code . In VSCode, I paste the following (without imports) into package main
type Soup struct {
Chicken bool
}
var _ json.Marshaler = (*Soup)(nil)
func (soup *Soup) MarshalJSON() ([]byte, error) {
if soup.Chicken {
return []byte(`"yum!"`), nil
}
return []byte(`"meh"`), nil
}
func main() {
soup := &Soup{}
data, err := json.Marshal(soup)
if err != nil {
log.Fatal(err)
}
fmt.Printf("soup: %s\n", string(data))
} I see this output from the Go extension:
After accepting the first suggested fix (import
At this point, the extension no longer works, and I see this "Your workspace is misconfigured" dialog. |
I have the same issues. When you change branch on git it happens and restarting the language server it works. I don't know if it is related with golangci |
golangci-lint has version 1.25.0 built from 3082512 on 2020-04-22T23:03:03Z go version go1.14 darwin/amd64 GoLand 2020.1 and I add File Watcher using existing golangci-lint template. when I save it, it seems to report "level=warning msg="[runner] Can't run linter goanalysis_metalinter: asmdecl: analysis skipped: "..... |
Hey, please provide a way to reproduce this issue. |
Hey @ernado. The simplest method to reproduce the issue is to use an older version of golangci-lint (in our case, 1.21.0) and Go 1.14. The combination results in Updating to golangci-lint 1.27.0 fixed this for us. It likely has to do with the fact that 1.21.0 was compiled with an older version of Go, and is incompatible when building packages with Go 1.14. A recent CI run from helm/helm shows the same error message, which uses the same golangci-lint and Go version reported:
While updating to a newer version of golangci-lint does indeed fix this issue, my main concern lies with the fact that an update to Go 1.14 caused golangci-lint to succeed in cases where compiling the project should've failed. It is entirely possible this may arise again in the future. I'm wondering if there's an error case that can be captured here that should report an error rather than logging a warning. Hope this helps. |
Great investigation, @bacongobbler, thank you! It is correct, older versions of golangci-lint can silently fail in such conditions :( |
I'll close this issue for now. Feel free to open another issue if this re-occurs for version after Thanks everybody. |
Because golangci-lint fails frequently because of the issues in tool itself `retry` strategy was added. golangci/golangci-lint#896
Thank you for creating the issue!
Please include the following information:
Version of golangci-lint
Config file
Go environment
Verbose output of running
The text was updated successfully, but these errors were encountered: