-
Notifications
You must be signed in to change notification settings - Fork 2.3k
go/packages: do not nullify Fset when NeedSyntax is set #506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR (HEAD: 78f90b8) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/601239. Important tips:
|
Copied the markdown description from the first message for humans to see because Gopher Robot complained about it. Problem
Lines 758 to 761 in da12580
However, later, it is nullified on a slightly different condition: Lines 962 to 966 in 8b51d66
Solution Use the same but inverse condition when deciding on whether to nullify Resolves golang/go#48226. |
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Nikolay Edigaryev: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Michael Matloob: Patch Set 2: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Alan Donovan: Patch Set 2: Code-Review+2 Commit-Queue+1 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Go LUCI: Patch Set 2: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-07-31T17:17:07Z","revision":"212b14cbab8f8831b08a16ac8d28371b2be62a30"} Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
This PR (HEAD: a906871) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/601239. Important tips:
|
Message from Go LUCI: Patch Set 2: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Nikolay Edigaryev: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Michael Matloob: Patch Set 3: Code-Review+2 Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Go LUCI: Patch Set 3: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-08-01T19:56:03Z","revision":"27bae963aaa45c4e71e4cf05364c2f8be3bb437c"} Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Michael Matloob: Patch Set 3: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Go LUCI: Patch Set 3: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Message from Go LUCI: Patch Set 3: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/601239. |
Currently, Fset is initialized when either NeedTypes or NeedSyntax are set in newLoader(). However, later in refine() it is nullified using a different condition that doesn't take NeedSyntax into account. Use the inverse condition to that of in newLoader() when deciding on whether to nullify Fset or not. Resolves golang/go#48226. Change-Id: Ic7c05dfe3337d5cf14aa185350a8e766e224c898 GitHub-Last-Rev: a906871 GitHub-Pull-Request: #506 Reviewed-on: https://go-review.googlesource.com/c/tools/+/601239 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
This PR is being closed because golang.org/cl/601239 has been merged. |
Currently, Fset is initialized when either NeedTypes or NeedSyntax are set in newLoader().
However, later in refine() it is nullified using a different condition that doesn't take NeedSyntax into account.
Use the inverse condition to that of in newLoader() when deciding on whether to nullify Fset or not.
Resolves golang/go#48226.