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: inaccurate go mod download errors #30743

Closed
marwan-at-work opened this issue Mar 11, 2019 · 2 comments
Closed

cmd/go: inaccurate go mod download errors #30743

marwan-at-work opened this issue Mar 11, 2019 · 2 comments

Comments

@marwan-at-work
Copy link
Contributor

@marwan-at-work marwan-at-work commented Mar 11, 2019

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

$ go version
go version go1.12 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

  1. go mod download -json bad/path@latest
  2. go mod download -json bad/path@v0.9.0
  3. go mod download -json github.com/gomods/moduledoesnotexist@latest
  4. go mod download -json github.com/gomods/moduledoesnotexist@v0.9.0

What did you expect to see?

  1. Reliable code or message to say it's a bad module path
  2. Reliable code or message to say it's a bad module path.
  3. Reliable code or message to say that the module does not exist.
  4. Reliable code or message to say that the module does not exist.

What did you see instead?

  1. Incorrect error message: it should prioritize saying that the module path is incorrect rather than that the version invalid. In fact, latest is not invalid.
{
	"Path": "github.com/gomods/moduledoesnotexist",
	"Version": "latest",
	"Error": "invalid version \"latest\""
}
  1. Correct error message, comparing against no.1 above, but it might be helpful to lock the message or introduce an error code.
{
	"Path": "bad/path",
	"Version": "v0.9.0",
	"Error": "unrecognized import path \"bad/path\" (import path does not begin with hostname)"
}
  1. Incorrect error message same as no.1
{
	"Path": "github.com/gomods/moduledoesnotexist",
	"Version": "latest",
	"Error": "invalid version \"latest\""
}
  1. Inaccurate error message: it should tell us that the Repository is not found, instead of "invalid revision"
{
	"Path": "github.com/gomods/moduledoesnotexist",
	"Version": "v0.9.0",
	"Error": "unknown revision v0.9.0"
}

cc: @jayconrod

@jayconrod

This comment has been minimized.

Copy link
Contributor

@jayconrod jayconrod commented Mar 11, 2019

Related #30134

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Aug 7, 2019

Change https://golang.org/cl/189323 mentions this issue: cmd/go: improve 'go mod download' and 'go list -m' error messages

@gopherbot gopherbot closed this in 1dc0110 Aug 8, 2019
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.