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

x/tools/go/packages: misleading error messages #29529

Open
pjweinb opened this issue Jan 3, 2019 · 2 comments
Open

x/tools/go/packages: misleading error messages #29529

pjweinb opened this issue Jan 3, 2019 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@pjweinb
Copy link

pjweinb commented Jan 3, 2019

go list is sensitive to GOPATH, but the error message do not tell the user what to do.
In particular
go list -deps=true -- ~/gostuff/foo
fails with "cannot import absolute path" if GOPATH doesn't include ~/gostuff, but works if it does.

@gopherbot gopherbot added this to the Unreleased milestone Jan 3, 2019
@pjweinb
Copy link
Author

pjweinb commented Jan 4, 2019

go list ~/foo.go returns "command-line-arguments"

I don't know what it should return (maybe an error "~/foo.go is not a package"?)

go list -deps ~/foo.go
helpfully returns a list of packages, followed by the mysterious "command-line-arguments", which seems to be an internal made-up package name placeholder, but it's confusing.

@pjweinb pjweinb changed the title x/tools/go/packages x/tools/go/packages: misleading error messages Jan 4, 2019
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 20, 2019
@matloob
Copy link
Contributor

matloob commented Mar 22, 2019

I'll assign to myself to make sure the errors returned by go/packages are clear, and i'll unassign again for the investigation/decision of what to do for go list itself

@matloob matloob self-assigned this Mar 22, 2019
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@rsc rsc unassigned matloob Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants