-
Notifications
You must be signed in to change notification settings - Fork 200
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
Fix loading packages with Go modules disabled #291
base: master
Are you sure you want to change the base?
Fix loading packages with Go modules disabled #291
Conversation
This allows the parser to load packages even when Go modules are disabled, and when GOPATH mode is used. This is especially useful in Debian as we build Go packages in GOPATH mode, and the tests are also run in this mode.
The committers listed above are authorized under a signed CLA. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: n-peugnet The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @n-peugnet! |
Hi @n-peugnet. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
While packaging the v2 of this library in Debian, most of the tests were failing. This is because we use the GOPATH mode (so with Go modules disabled) to build and test packages.
This allows the parser to load packages even when Go modules are disabled, and when GOPATH mode is used.
I am not sure if this is the best way to handle this, but at least it works with Go modules either disabled or enabled. I don't really know either why the
PkgPath
looks like this in GOPATH mode, I didn't find ingolang.org/x/tools
's code where exactly this string is constructed from a quick search. So feel free to suggest a better way to solve this.For the record, here is the kind of error that we got from running the tests in GOPATH mode: