-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/go: don't compute Embed fields if they're not needed #58522
cmd/go: don't compute Embed fields if they're not needed #58522
Conversation
This PR (HEAD: 3c6c17f) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/468075 to see it. Tip: You can toggle comments from me using the |
3c6c17f
to
9ca3695
Compare
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
This PR (HEAD: 9ca3695) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/468075 to see it. Tip: You can toggle comments from me using the |
9ca3695
to
dcf229b
Compare
This PR (HEAD: dcf229b) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/468075 to see it. Tip: You can toggle comments from me using the |
dcf229b
to
3c58e7a
Compare
This PR (HEAD: 3c58e7a) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/468075 to see it. Tip: You can toggle comments from me using the |
Message from Ian Lance Taylor: Patch Set 4: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Gopher Robot: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Gopher Robot: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Gopher Robot: Patch Set 4: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Bryan Mills: Patch Set 4: Code-Review+2 Hold+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Bryan Mills: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Frank Viernau: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Bryan Mills: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
If the user provides the -json flag to explicitly specify fields, but doesn't specify any *Embed* field, skip computing the embed fields. This enhances the initial implementation of golang#29666.
3c58e7a
to
2795c19
Compare
Message from Frank Viernau: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
This PR (HEAD: 2795c19) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/468075 to see it. Tip: You can toggle comments from me using the |
Message from Frank Viernau: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Frank Viernau: Patch Set 5: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Bryan Mills: Patch Set 5: Code-Review+2 Hold+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
`gopls` attempts to diagnose incorrect embed patterns. The logic to do so relies on `go list` to actually resolve those patterns and to propagate an error in case the pattern is incorrect, see also [1]. `go pls` explicitly specifies the needed JSON fields towards `go list -json` which internall skips evaluation steps for unneeded fields. Currently, the embed patterns are always evaluated but there is plans to change it such that patterns are only evaluated if needed [2]. So, explicitly ask for EmbedFiles to prepare for [2]. [1]: https://github.com/golang/tools/blob/193023cca0b707b4d668e5d332649cba285e99f7/gopls/internal/regtest/misc/embed_test.go#L26-L40 [2]: golang/go#58522 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
`gopls` attempts to diagnose incorrect embed patterns. The logic to do so relies on `go list` to actually resolve those patterns and to propagate an error in case the pattern is incorrect, see also [1]. `go pls` explicitly specifies the needed JSON fields towards `go list -json` which internally skips evaluation steps for unneeded fields. Currently, the embed patterns are always evaluated but there is plans to only run pattern evaluation if needed [2]. So, explicitly ask for EmbedFiles to prepare for [2]. [1]: https://github.com/golang/tools/blob/193023cca0b707b4d668e5d332649cba285e99f7/gopls/internal/regtest/misc/embed_test.go#L26-L40 [2]: golang/go#58522 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
`gopls` attempts to diagnose incorrect embed patterns. The logic to do so relies on `go list` to actually resolve those patterns and to propagate an error in case the pattern is incorrect, see also [1]. `go pls` explicitly specifies the needed JSON fields towards `go list -json` which internally skips evaluation steps for unneeded fields. Currently, the embed patterns are always evaluated but there is plans to only run pattern evaluation if needed [2]. So, explicitly ask for EmbedFiles to prepare for [2]. [1]: https://github.com/golang/tools/blob/193023cca0b707b4d668e5d332649cba285e99f7/gopls/internal/regtest/misc/embed_test.go#L26-L40 [2]: golang/go#58522
Message from Frank Viernau: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
`gopls` attempts to diagnose incorrect embed patterns. The logic to do so relies on `go list` to actually resolve those patterns and to propagate an error in case the pattern is incorrect, see also [1]. `go pls` explicitly specifies the needed JSON fields towards `go list -json` which internally skips evaluation steps for unneeded fields. Currently, the embed patterns are always evaluated but there is plans to only run pattern evaluation if needed [2]. So, explicitly ask for EmbedFiles to prepare for [2]. [1]: https://github.com/golang/tools/blob/193023cca0b707b4d668e5d332649cba285e99f7/gopls/internal/regtest/misc/embed_test.go#L26-L40 [2]: golang/go#58522
Message from Frank Viernau: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
`Gopls` attempts to diagnose incorrect embed patterns. The logic to do so relies on `go list` to actually resolve those patterns and to propagate an error in case the pattern is incorrect, see also [1]. `Gopls` explicitly specifies the needed JSON fields towards `go list -json` which internally skips evaluation steps for unneeded fields. Currently, the embed patterns are always evaluated but there is plans to only run pattern evaluation if needed [2]. So, explicitly ask for EmbedFiles to prepare for [2]. [1]: https://github.com/golang/tools/blob/193023cca0b707b4d668e5d332649cba285e99f7/gopls/internal/regtest/misc/embed_test.go#L26-L40 [2]: golang/go#58522
Gopls attempts to diagnose incorrect embed patterns. The logic to do so relies on 'go list' to actually resolve those patterns and to propagate an error in case the pattern is incorrect, see also [1]. Gopls explicitly specifies the needed JSON fields towards 'go list -json' which internally skips evaluation steps for unneeded fields. Currently, the embed patterns are always evaluated but there is plans to only run pattern evaluation if needed [2]. So, explicitly ask for EmbedFiles to prepare for [2]. [1]: https://github.com/golang/tools/blob/193023cca0b707b4d668e5d332649cba285e99f7/gopls/internal/regtest/misc/embed_test.go#L26-L40 [2]: golang/go#58522 Change-Id: I615cd5076659f192d884504ab735ce77b6e0e129 GitHub-Last-Rev: 9c1addb GitHub-Pull-Request: #428 Reviewed-on: https://go-review.googlesource.com/c/tools/+/470157 Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Message from Bryan Mills: Patch Set 5: -Hold Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Bryan Mills: Patch Set 5: Run-TryBot+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Gopher Robot: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Gopher Robot: Patch Set 5: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
Message from Bryan Mills: Patch Set 5: Auto-Submit+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/468075. |
If the user provides the -json flag to explicitly specify fields, but doesn't specify any *Embed* field, skip computing the embed fields. This enhances the initial implementation of #29666. Change-Id: I60e86fb25a445689aecbcc7f3f3f88e0f37a0fc5 GitHub-Last-Rev: 2795c19 GitHub-Pull-Request: #58522 Reviewed-on: https://go-review.googlesource.com/c/go/+/468075 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Auto-Submit: Bryan Mills <bcmills@google.com>
This PR is being closed because golang.org/cl/468075 has been merged. |
If the user provides the -json flag to explicitly specify fields, but doesn't specify any Embed field, skip computing the embed fields.
This enhances the initial implementation of #29666.