-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
go/build: Context.Import no longer returns a NoGoError
with -mod=vendor
#58903
Comments
NoGoError
with -mod=vendor
It isn't clear to me when or why this would have changed, but I think the reported Go 1.20 behavior of
|
FWIW - I can add a
Can you clarify this point? Are you saying that because ie. moduleA - go.mod declares it's package as
Likewise - I don't really understand. My assumption is a |
Probably also worth calling out is that a lot of modules don't have ie.
ie. empirical examples Should they be adding these empty files now? |
Yes. You could have a module structured like:
Or like:
|
In that example wouldn't you assume |
No. I think you are conflating modules and packages? A module is “a collection of packages that are released, versioned, and distributed together.” In this case, the module is However, the fact that they do not exist in the current module does not imply that they don't exist in some other module.
In contrast, |
OK that clears things up - looks like |
Thanks for all the clarifying answers. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes,
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Some tooling uses
go/build::Context.ImportDir
to collect type/package info to use to generate docs and code. ahmetb/gen-crd-api-reference-docs#61https://github.com/kubernetes/gengo/blob/ab3349d207d4cc9f4bc5c37ba6aa062b4b2ffacc/parser/parse.go#L157
What did you expect to see?
Tool runs
What did you see instead?
Starting with go1.20 these tools started to fail. Creating a simple repro example the error from
go/build
isRepro case (go1.19):
With 1.19 it panics it doesn't return any packages (which is fine because the above linked tools handle this case)
The text was updated successfully, but these errors were encountered: