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/mod: move cmd/go/internal/modfile into x/mod for go.mod parsing and formatting #34924

Closed
zshift opened this issue Oct 15, 2019 · 7 comments
Closed
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@zshift
Copy link

zshift commented Oct 15, 2019

Expose modfile parsing as an importable module

I'd like the ability to parse modfile for purpose of repo analysis across various projects and repositories. Currently, the logic exists within an internal package, and the go modfile design does not follow an existing standard. Instead of requiring a 3rd-party implementation, which would likely stray from the modfile standard in future versions, it would be convenient to expose the existing, internal package for this.

@zshift zshift changed the title cmd/go/internal/modfile: Expose modfile parsing as importable module proposal: cmd/go/internal/modfile: Expose modfile parsing as importable module Oct 15, 2019
@gopherbot gopherbot added this to the Proposal milestone Oct 15, 2019
@matyat
Copy link

matyat commented Oct 16, 2019

A nice addition to this would be exposing cmd/go/internal/modload as well, so finding the modfile in a repo is possible.

@ianlancetaylor
Copy link
Contributor

This seems to be underway in https://godoc.org/golang.org/x/mod.

CC @jayconrod

@jayconrod
Copy link
Contributor

I'm going to triage this as a feature request in x/mod, rather than a proposal. We'll move this package over relatively soon. It's small, has few dependencies, and the API is stable.

@jayconrod jayconrod added NeedsFix The path to resolution is known, but the work has not been done. and removed Proposal labels Oct 16, 2019
@jayconrod jayconrod modified the milestones: Proposal, Unreleased Oct 16, 2019
@jayconrod jayconrod changed the title proposal: cmd/go/internal/modfile: Expose modfile parsing as importable module x/mod: move cmd/go/internal/modfile into x/mod for go.mod parsing and formatting Oct 16, 2019
@jayconrod
Copy link
Contributor

A nice addition to this would be exposing cmd/go/internal/modload as well, so finding the modfile in a repo is possible.

modload is a large package with an unstable interface and unsynchronized global state. It will not be moved to x/mod as it is. It's something we'd like to do eventually, but we'll need to do a lot of refactoring and restructuring first.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/202565 mentions this issue: cmd/go/internal/modfile: prepare to move to x/mod

gopherbot pushed a commit that referenced this issue Oct 22, 2019
- Deleted dead code in gopkgin.go.
- Minor documentation changes.

Updates #34924

Change-Id: Ie2c744bbf6662cae20f09163200f20d7589fd237
Reviewed-on: https://go-review.googlesource.com/c/go/+/202565
Run-TryBot: Jay Conrod <[email protected]>
Reviewed-by: Bryan C. Mills <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/202543 mentions this issue: modfile: copy from cmd/go/internal/modfile

gopherbot pushed a commit to golang/mod that referenced this issue Oct 22, 2019
Copied from 4be6b4a73d (CL 202565). No changes other than import paths.

Updates golang/go#34924
Updates golang/go#31761

Change-Id: Ic25cb983f6641045fc24edf76953b06d4aa5cd43
Reviewed-on: https://go-review.googlesource.com/c/mod/+/202543
Reviewed-by: Bryan C. Mills <[email protected]>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/202698 mentions this issue: cmd/go: delete internal packages moved to x/mod

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

No branches or pull requests

5 participants