/ go Public
cmd/go: awkward "list -json" error reporting for a
vendor subdirectory that does not contain a Go package
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
What did you do?
Run the following to create a module that vendors its dependencies and then run
go list -e -json:
What did you expect to see?
The JSON struct information for the requested module should contain the
Dirfield that indicates the directory for the module (the path should be in the vendor directory).
What did you see instead?
The JSON struct printed as part of the output does not have a
This is the output of the command in the same directory using Go 1.19:
For context, the code I wrote that depends on this is doing the following:
The output of
go listthrough Go 1.19 allowed this to be done, but the behavior change in Go 1.20 breaks this workflow, and I'm unsure why the output changed in this case.
"cannot query module due to -mod=vendor\n\t(Go version in go.mod is at least 1.14 and vendor directory exists.)"is also misleading, since if the query is changed to be a package (
listoperation succeeds and prints the package information (even though the same condition of "Go version in go.mod is at least 1.14 and vendor directory exists." is still true).
The text was updated successfully, but these errors were encountered: