Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Golang GVM 修改国内镜像

使用 GVM 安装不同版本的 Go。碰到问题是国内无法访问 GVM 配置的源地址。报如下错误:

[root@mq:/home/wwwroot/]
$ gvm install go1.8
Downloading Go source...
Installing go1.8...
 * Compiling...
ERROR: Couldn't download Go source. Check the logs /root/.gvm/logs/go-download.log
$ cat /root/.gvm/logs/go-download.log
Initialized empty Git repository in /root/.gvm/archive/go/.git/
error: Failed connect to go.googlesource.com:443; Operation now in progress while accessing https://go.googlesource.com/go/info/refs

fatal: HTTP request failed
Initialized empty Git repository in /root/.gvm/archive/go/.git/
Initialized empty Git repository in /root/.gvm/archive/go/.git/

国内访问不了https://go.googlesource.com/go 可将 GO_SOURCE_URL修改为github上的源码镜像

修改方法:

vim ~/.gvm/scripts/install

修改

GO_SOURCE_URL=https://github.com/golang/go
@nicozhang

This comment has been minimized.

Copy link

commented Mar 1, 2019

gvm listall 命令也可以改成git的地址,多谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.