Skip to content
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

x/vuln/cmd/govulncheck: avoid mutating go/build.Default context #55305

Closed
hyangah opened this issue Sep 21, 2022 · 1 comment
Closed

x/vuln/cmd/govulncheck: avoid mutating go/build.Default context #55305

hyangah opened this issue Sep 21, 2022 · 1 comment
Assignees
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Sep 21, 2022

In https://github.com/golang/vuln/blob/d9be10b6cc846585ded9197e3a20ea2661da49f7/cmd/govulncheck/main.go#L34
-tags flag mutates go/build.Default.BuildTags.
In old days, adjusting the go/build default context was necessary to minimize confusions stem from differences in local/external build contexts. However, with golang.org/x/tools/go/packages this is no longer necessary in most cases.

Don't mutate go/build.Default context, but pass the info to go/packages load configuration.

cc @zpavlinovic

@gopherbot gopherbot added this to the Unreleased milestone Sep 21, 2022
@zpavlinovic zpavlinovic self-assigned this Sep 21, 2022
@zpavlinovic zpavlinovic modified the milestones: Unreleased, vuln/2022 Sep 22, 2022
@zpavlinovic
Copy link
Contributor

Fixed here.

@golang golang locked and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants