g
g copied to clipboard
Install fails when setting URL with context path to G_MIRROR
Describe the bug/缺陷描述 Install fails when setting URL with context path to G_MIRROR
To Reproduce/缺陷复现步骤 Steps to reproduce the behavior:
- set G_MIRROR with context path url, like https://aaa.com/bbb/dl. context means bbb
- g ls-remote is fine
- g install 1.21.0
- Trying to download from wrong URL [g] Url "https://aaa.com/dl/go1.21.0.windows-amd64.zip" is unreachable ==> 404
Expected behavior/期望行为 expected download url is 'https://aaa.com/bbb/dl', but 'https://aaa.com/dl' missing context path bbb
Screenshots/实际运行结果截图 If applicable, add screenshots to help explain your problem.
Environments (please complete the following information)/运行环境:
-
OS[e.g. uname -a] Windows 10
-
g -v
1.6.0 ```
-
go env
-
echo $G_EXPERIMENTAL
-
echo $G_HOME
-
echo $G_MIRROR
https://aaa.com/bbb/dl ```
Additional context/额外信息 Add any other context about the problem here.
Unable to reproduce the issue. Please follow the steps below:
- Set the
G_MIRROR
environment variable(export G_MIRROR=https://aaa.com/bbb/dl
) - Execute command:
g env
- Execute command:
g install 1.21.0
Please provide the complete output of the above commands.
https://github.com/voidint/g/blob/master/collector/official/official_collector.go#L58