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
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@marwan-at-work
Copy link
Contributor

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 jayconrod added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go modules labels Mar 11, 2019
@jayconrod jayconrod self-assigned this Mar 11, 2019
@jayconrod
Copy link
Contributor

Related #30134

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Aug 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants