-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: when initializing a go.mod from other formats, verify dependency module paths before saving? #30161
Comments
Just to be sure that this isn't an issue that has already been fixed, try updating to the newest version of Go and trying again. /cc @bcmills |
I was able to reproduce this with a newer version of Go. This project doesn't have a go.mod file, so when it's built with
@bcmills I think this could be fixed in Related: this |
Assuming that you don't actually need the |
Since Probably the best we can do in terms of a general fix would be to download the |
Following that strategy, we'd lose some fidelity when importing from dep and other tools, but it seems preferable to writing out a broken Russ pointed out that I'm not sure if vendoring tools handle this tag. It's documented in |
Is there any doc that describe difference between v1 and v2, alse the different way |
@daixiang0 To answer this specifically though, when a module is versioned at v2.0.0 or greater, its path must have the suffix In this project, there isn't a direct dependency on Concretely, you may be able to get this to work by depending on |
@daixiang0 I just wanted to briefly expand on some of the points from @jayconrod, as well as ask a few questions. The first is I was wondering if your intent is to convert this If so, it would be more conventional I think to first run Separately, as @jayconrod said, the root of the problem seems to be
I also then ran In terms of where the
Both of those dependencies themselves seem to already have a
However, if you run Sorry if any of that is confusing or if I missed something here, but if correct, I think it would both explain where the Finally, I should add that it is just a guess as to what |
@bcmills @jayconrod @thepudds Thanks very much. Now i learn something about how I follow tip and find there is no
Then i call
The guess about why
I am happy to contribute to docs about above ideas if possible. Thanks again for your patient explanation。 |
Whether you call
I don't think we should bail out entirely if there's an error importing from dep, especially if it's an error in a dependency the users can't directly address. In this case, there's a workaround (deleting problematic requirements and re-running
It can be useful to import versions from |
Note that as of #29433, you will not be able to run |
|
@daixiang0 I'm not sure more documentation is needed for this, but the Modules wiki is probably the right place if any details are missing. Specifically, I have a problem with a complex dependency that has not opted in to modules. Can I use information from its current dependency manager? and FAQs — Possible Problems. |
The repo is loki, after use
dep ensure
at master branch:I do not know how to fix this.
The text was updated successfully, but these errors were encountered: