g icon indicating copy to clipboard operation
g copied to clipboard

Install fails when setting URL with context path to G_MIRROR

Open tkyggit opened this issue 1 year ago • 2 comments

Describe the bug/缺陷描述 Install fails when setting URL with context path to G_MIRROR

To Reproduce/缺陷复现步骤 Steps to reproduce the behavior:

  1. set G_MIRROR with context path url, like https://aaa.com/bbb/dl. context means bbb
  2. g ls-remote is fine
  3. g install 1.21.0
  4. 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.

tkyggit avatar Feb 15 '24 11:02 tkyggit

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.

voidint avatar Feb 15 '24 14:02 voidint

https://github.com/voidint/g/blob/master/collector/official/official_collector.go#L58

voidint avatar Feb 15 '24 14:02 voidint