Skip to content

cmd/go, x/tools/gopls: misleading errors for invalid import #59433

@findleyr

Description

@findleyr

Just noticed this while refactoring import paths:

image

In this case, I'm in the process of moving the 'tag' package, and the old location no longer exists. I believe the error message is due to the logic here: https://cs.opensource.google/go/x/tools/+/master:internal/gcimporter/iimport.go;l=218;drc=fa556487c5c2be818dd2bab43e16f1afa06f8f89

The problem is that we're now importing packages with broken metadata, and invalid imports appear to have package path "".

Metadata

Metadata

Assignees

Labels

GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/incrementalgopls/metadataIssues related to metadata loading in gopls

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions