Closed
Description
This has been discussed fairly often, but I figured it was worth filing an issue for tracking purposes.
Many tools, gopls
in particular, work on unsaved files. As a result, tools like go/packages support overlays, which can replace file contents or represent entirely new files. The overlay logic for go list
in go/packages is complex and error-prone, as it effectively needs to recreate the behavior of go list
. It is a constant source of gopls
bugs, many of which (#39646 for a recent example) manifest in seemingly unrelated ways. Supporting overlays natively in the go
command would eliminate all of this complicated logic and this source of errors.