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/vgo: wrong error when x/go.mod tag v2.0.0 does not say module "x/v2" #24522

Closed
kybin opened this issue Mar 25, 2018 · 6 comments
Closed

x/vgo: wrong error when x/go.mod tag v2.0.0 does not say module "x/v2" #24522

kybin opened this issue Mar 25, 2018 · 6 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@kybin
Copy link
Contributor

kybin commented Mar 25, 2018

I am developing a program which uses russross/blackfriday and of course it does not support vgo yet, so I tried fork and add go.mod myself for fun.

Because blackfriday reaches v2.0.0 and developed in v2 branch, I had to checkout to v2 branch.
I added go.mod file there but I didn't put version to it's module path by mistake.
So the file started with module "github.com/kybin/blackfriday" not module "github.com/kybin/blackfriday/v2".
Then I tagged it as v2.0.1.

When I ran vgo get -u from my repository, it panicked with vgo: github.com/kybin/blackfriday/v2 v2.0.1: missing go.mod.
It confuses me because I know the file exists.

I checked vgo source and found modfetch.codeRepo.findDir returns wrong error when the module path does not have version info.

It would be better the error message is something like go.mod's module path is not matched with it's tag version.

Thank you.

@gopherbot gopherbot added this to the vgo milestone Mar 25, 2018
@rsc rsc changed the title x/vgo: get -u panics with wrong error message when the dependency's go.mod module path missed version. x/vgo: wrong error when x/go.mod tag v2.0.0 does not say module "x/v2" Mar 30, 2018
@rsc
Copy link
Contributor

rsc commented Mar 30, 2018

I agree, the error should be fixed.

@rsc rsc added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 30, 2018
@vbmade2000
Copy link

Can I work on it ?

@gopherbot
Copy link

Change https://golang.org/cl/106982 mentions this issue: x/vgo: fix error message when go.mod read failed

@gopherbot
Copy link

Change https://golang.org/cl/114005 mentions this issue: cmd/go/internal/modfetch: return more accurate error messages

@gopherbot
Copy link

Change https://golang.org/cl/122399 mentions this issue: cmd/go/internal/modfetch: add detail to "missing go.mod" errors

@rsc
Copy link
Contributor

rsc commented Jul 6, 2018

Thanks for the great explanation. I sent https://golang.org/cl/122399 to clear up this situation.

@golang golang locked and limited conversation to collaborators Jul 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants