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: misleading error message #31775

Closed
go101 opened this issue May 1, 2019 · 3 comments
Closed

cmd/go: misleading error message #31775

go101 opened this issue May 1, 2019 · 3 comments

Comments

@go101
Copy link

@go101 go101 commented May 1, 2019

What version of Go are you using (go version)?

go version devel +ba978f5fff Tue Apr 30 23:31:26 2019 +0000 linux/amd64

What did you do?

module example.com/myapp v2.0.0
go build

What did you expect to see?

go: errors parsing go.mod:
/tmp/foo/go.mod:1: usage: module module/path

What did you see instead?

go: errors parsing go.mod:
/tmp/foo/go.mod:1: usage: module module/path [version]
@katiehockman

This comment has been minimized.

Copy link
Member

@katiehockman katiehockman commented May 1, 2019

Hi @go101, could you please provide more context here? It would be helpful if you could run go env and give the output, as well as give more context about what exactly you think is misleading/missing about the current error message.

@go101

This comment has been minimized.

Copy link
Author

@go101 go101 commented May 2, 2019

go env doesn't help for this issue.

What I mean is the error message indicates that a version is allowed to be specified in the module directive, but in fact, it is not allowed.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented May 2, 2019

Change https://golang.org/cl/175017 mentions this issue: cmd/go/internal/modfile: make error message for module path more clear

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