-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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/internal/list: insufficient error tolerance on listing packages #59785
Comments
I'm unfamiliar with golang source but I suspect that it's the // src/cmd/go/internal/list/list.go#L605-L612
pkgOpts := load.PackageOpts{
IgnoreImports: *listFind,
ModResolveTests: *listTest,
AutoVCS: true,
SuppressBuildInfo: !*listExport && !listJsonFields.needAny("Stale", "StaleReason"),
SuppressEmbedFiles: !*listExport && !listJsonFields.needAny("EmbedFiles", "TestEmbedFiles", "XTestEmbedFiles"),
}
pkgs := load.PackagesAndErrors(ctx, pkgOpts, args) |
I dug deeper and found that it's not only about AutoVCS, but: when not listing modules (without I think that |
After getting around this by recompiling the go binary with
they all exited with code 1 due to the repo permission issue. |
does this really need more than a month to investigate? 🤔 at least some progress would be nice please? |
This issue is in the backlog, and Go is an open-source project. If you would like to help move it along, I would be glad to review a change to fix it. |
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?
I used vscode-go for browsing a repository that I don't have permissions to access it's dependencies.
the extension fails to load the workspace complaining that I have no permissions to
go get
related repos, so vscode can't even index the existing sources that I have.After digging in a little deeper, I found that the command giving the complain is:
https://github.com/golang/vscode-go/blob/master/src/goPackages.ts#L60
What did you expect to see?
I expected
go list
to tolerate the errors as what it's told to by passing the-e
argument.What did you see instead?
instead, it tried to download the missing packages (due to permission errors) and failed if download fails.
Current Workaround
For anyone who ends up in a similar situation, maybe you could try
go mod tidy -e
and then disable the go modules by setting:in
.vscode/settings.json
. Themodload
package seems to work with go packages.The text was updated successfully, but these errors were encountered: