-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/cache: id command-line-arguments packages using GoFiles
Previously, we were using the first CompiledGoFiles to disambiguate the ID of command-line-arguments packages, but in the presence of cgo preprocessing there can actually be multiple CompiledGoFiles, leading to the bug report of golang/go#64557. Fix this by using GoFiles instead. Fixes golang/go#64557 Change-Id: I3eff976d07da32db1f26ced69228af41a388d9a1 Reviewed-on: https://go-review.googlesource.com/c/tools/+/627776 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Findley <rfindley@google.com>
- Loading branch information
Showing
2 changed files
with
38 additions
and
9 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
27 changes: 27 additions & 0 deletions
27
gopls/internal/test/marker/testdata/definition/standalone_issue64557.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
This test checks that we can load standalone files that use cgo. | ||
|
||
-- go.mod -- | ||
module example.com | ||
|
||
-- main.go -- | ||
//go:build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"C" | ||
|
||
"example.com/a" | ||
) | ||
|
||
func F() {} //@loc(F, "F") | ||
|
||
func main() { | ||
F() //@def("F", F) | ||
println(a.A) //@def("A", A) | ||
} | ||
|
||
-- a/a.go -- | ||
package a | ||
|
||
const A = 0 //@loc(A, "A") |