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 and rooted paths #14177
Comments
I don't think the problem is wordsmithing, it's that the go tool doesn't accept rooted paths. |
Yeah agree, it's a go tool bug. |
I'm searching for the reason why go tool doesn't accept absolute (rooted?) import paths. So far I couldn't find any rationale for that behavior, and just found this issue. Is this actually a bug of go tool? It affects other actions like install, build, etc.
|
Well, import declarations in files cannot use rooted paths, and the go tool takes import paths on the command line, so that is at least consistent. |
Is this going to get fixed?
kinda sucks. |
@jeffreydwalter I think that is a different problem. |
@ianlancetaylor, I don't really follow. How does ./foo/... is a relative path, just like foo/..., isn't it? I assume the issue is that the path that starts with . is being treated as a relative path and the one without is not, but that seems wrong to me.
|
|
@dominikh, thanks for the explanation. I just read the |
cc @bcmills I vote for fixing this rather than changing the documentation. My conception of go list is not that it takes package paths on the command line, but patterns that resolve to package paths. For instance, ./foo/... is not a package path but a pattern that resolves to all the subpackages of foo. Similarly, in my model at least, an absolute path should resolve to the package in the given directory. Of course that package should either be contained in GOPATH, GOROOT, or in the transitive set of modules depended on by the current module. |
cc @suzmue Thanks! |
Fixed by golang.org/cl/126715. |
Change https://golang.org/cl/126715 mentions this issue: |
go help packages says:
The way I interpret it is that
should list the goprint package; however go list reports an error:
The text was updated successfully, but these errors were encountered: