x/tools/go/packages: clarify naming convention of overlay files #67541
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Go version
go version go1.22.3 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
https://pkg.go.dev/golang.org/x/tools/go/packages#DriverRequest
https://pkg.go.dev/golang.org/x/tools/go/packages#Config
The DriverRequest's documentation states that paths are relative meanwhile Config's documentation states the opposite.
There is no problem here but little inconsistency.
What did you see happen?
The next driver invocation that happens inside
packages.Load(...)
totally violates the path convention the documentation set.https://github.com/golang/tools/blob/c3aae998cf1d05bd3465e576730c67a9df71b4fa/go/packages/external.go#L112
cfg.Overlay
is not changed anywhere before.So on the left side there should be relative paths, on the other in fact absolute paths.
That is what a gopackagesdriver actually gets. Minimal repro looks like the following.
This driver is throwing an error that contains an absolute path.
What did you expect to see?
I expect the docs should not be misleading.
I think there is no reason for a driver to operate with relative paths.
So I would propose to fix the docs instead of changing the
packages.Load(...)
behavior.The text was updated successfully, but these errors were encountered: