-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/gcexportdata: fix Find for Go modules
Find needs to invoke the go command to find the package export data. It cannot rely on GOPATH-based file location heuristics. This has the nice side effect of automatically compiling the code, removing the possibility of stale export data. Ideally Find would use go/packages, but go/packages imports this package for the export data parser (not for Find itself), so we have to make do with an explicit go command invocation. Marked both Find and NewImporter deprecated: using go/packages will be faster for nearly all use cases, because it can gather info about multiple packages in a single go command invocation. They are essentially unused anyway. Removed the file name print from the example because the file may be in the cache, in which case it will not be named "fmt.a". Change-Id: I7940c90e230b22df9dcbfc8103a69a2d18df3bb0 Reviewed-on: https://go-review.googlesource.com/c/tools/+/310515 Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Russ Cox <rsc@golang.org> Auto-Submit: Russ Cox <rsc@golang.org>
- Loading branch information
Showing
3 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters