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

Comments

@pjweinb
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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

@matloob

This comment has been minimized.

Copy link
Contributor

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 label Sep 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.