Skip to content

Instantly share code, notes, and snippets.

@rambolee
Created May 9, 2017 06:31
Show Gist options
  • Save rambolee/f7bc4cfdc52d8c2535513bd933d71c78 to your computer and use it in GitHub Desktop.
Save rambolee/f7bc4cfdc52d8c2535513bd933d71c78 to your computer and use it in GitHub Desktop.
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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment