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

Feature mod aliases #1426

Closed
wants to merge 5 commits into from
Closed

Feature mod aliases #1426

wants to merge 5 commits into from

Conversation

ferryvg
Copy link

@ferryvg ferryvg commented Oct 18, 2019

What is the problem I am trying to address?
We need set source repo url for module

How is the fix applied?
Added new block to download.hcl and method like Mode.Match

Mention the issue number it fixes or add the details of the changes if it doesn't have a specific issue.

Fixes #1315, #1132, #1334

@ferryvg ferryvg requested a review from a team as a code owner October 18, 2019 14:32
@ferryvg
Copy link
Author

ferryvg commented Oct 22, 2019

Will be updated, because not working for 2+ versions of module

@ferryvg
Copy link
Author

ferryvg commented Oct 23, 2019

@ferryvg ferryvg closed this Oct 23, 2019
@blueworrybear
Copy link

@ferryvg
Hi, I'm looking forward to this Alias feature. Although, Go supports replace, it does not mean Alias is not useful.

For example, I cannot access some VCS repositories due to the firewall policy in my department. Although I can use either:

  1. go mod replace
  2. git insteadof configure
  3. Other goproxy server (Unfortunately, sometimes it's not working)

It's more convenience to me if I could set some redirection via Athens. Especially I could help my colleagues to avoid the same painful environment setup when they want to use the same modules.

Therefore, please don't give up working on the feature 👍

BTW, I would like to know what happened for 2+ version of module? As I know, go mod requests using url/to/module/v2 to denote breaking update. However, it seems to me that alias those URL is not impossible. Could we just replace v2 in Alias function?

@letian0805
Copy link

This feature is very useful! Why not merge it?

@arschles
Copy link
Member

@letian0805 if you'd like this feature, feel free to branch from it and open a new PR. the question I would pose, though, is what happens if you:

  • alias github.com/package/1 to github.com/package/2 on your athens server
  • run go get github.com/package/2

when the download happens, the go.mod that comes from the server will have module github.com/package/1 in it, so would you not need a replace directive in your own go.mod file anyway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

could athens support mirror?
4 participants