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

proposal: go.mod: add keyword to override differing import path #64081

Closed
mpldr opened this issue Nov 12, 2023 · 1 comment
Closed

proposal: go.mod: add keyword to override differing import path #64081

mpldr opened this issue Nov 12, 2023 · 1 comment

Comments

@mpldr
Copy link
Contributor

mpldr commented Nov 12, 2023

This proposal intends to address the Domain Expiration problem that is inherent to how Go handles package resolution.

The proposed solution is as follows:

  • add an override keyword with a syntax similar to replace
    • override expired-domain.com/pkg => github.com/original-author/go-pkg
    • overrides just the location the module is located at
    • version is kept as part of the required section
  • $SUMDB and go.sum assume expired-domain.com/pkg to be the import path and check the retrieved code against these known values
  • the source code is fetched from the new address by $GOPROXY and GOPROXY=direct connections
  • for developers running go get expired-domain.com/pkg@latest the information should still be looked for under the original domain.

override is project-specific and not intended to be a way to handle updating import paths. As such, it should be used with as much moderation and caution as is currently found with replace.

This way, it would also allow enterprises with strict compliance requirements to have a manual vetting process before making updates available (be it through review, or some other mechanism).

@mpldr mpldr added the Proposal label Nov 12, 2023
@gopherbot gopherbot added this to the Proposal milestone Nov 12, 2023
@seankhliao
Copy link
Member

Either replace already does this (point to new source location, but the retrieved module declares its module path as the old one)
or this is a dup of #26904

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2023
@golang golang locked and limited conversation to collaborators Nov 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants