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

cmd/go: 'go list -e' fails to report per-path results for nonexistent directories in module mode #28023

Closed
ianthehat opened this issue Oct 4, 2018 · 3 comments
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@ianthehat
Copy link

If you pass a broken pattern, go list is supposed to succeed but have a "package" with the errors in it.
For non existing directory patterns (that start with ./) this works in non module mode, but fails in module mode.

If you are using GOPATH:

% go list -e -json ./non_existant_dir
{
        "ImportPath": "golang.org/x/tools/non_existant_dir",
        "Match": [
                "./non_existant_dir"
        ],
        "Incomplete": true,
        "Error": {
                "ImportStack": [
                        "golang.org/x/tools/non_existant_dir"
                ],
                "Pos": "",
                "Err": "cannot find package \"golang.org/x/tools/non_existant_dir\" in any of:\n\t/usr/local/google/home/iancottrell/work/go/src/golang.org/x/tools/non_existant_dir (from $GOROOT)\n\t/usr/local/google/home/iancottrell/go/base/src/golang.org/x/tools/non_existant_dir (from $GOPATH)\n\t/usr/local/google/home/iancottrell/work/gopath/src/golang.org/x/tools/non_existant_dir"
        }
}

If you are in a module:

% go list -e -json ./non_existant_dir
go: no such directory ./non_existant_dir
@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 4, 2018
@bcmills bcmills added this to the Go1.12 milestone Oct 4, 2018
@bcmills bcmills changed the title cmd/go: go list fails the wrong way for non existent directories cmd/go: 'go list -e' fails to report per-path results for nonexistent directories in module mode Nov 14, 2018
@jayconrod
Copy link
Contributor

@bcmills I'm looking for some starter bugs to help me come up to speed on go list. Mind if I steal this one from you?

@jayconrod jayconrod assigned jayconrod and unassigned bcmills Nov 26, 2018
@bcmills
Copy link
Contributor

bcmills commented Nov 26, 2018

@jayconrod, all yours. Thanks for the help!

@gopherbot
Copy link

Change https://golang.org/cl/151800 mentions this issue: cmd/go: emit go list error for local non-existant packages

@golang golang locked and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants