简体   繁体   English

无法从 git clone go.googlesource.com 克隆 Git 存储库

[英]Unable to clone Git repositories from git clone go.googlesource.com

I would like to learn Go language so I wanted to start with tooling installation first.我想学习 Go 语言,所以我想先从工具安装开始。 However, I am not able to install golang tools with neither go get -u golang.org/x/tools nor git clone https://go.googlesource.com/tools .但是,我无法使用go get -u golang.org/x/toolsgit clone https://go.googlesource.com/tools安装 golang 工具。 Both of them results into Connection timeout error, the whole message is它们都导致连接超时错误,整个消息是

⇒  go get -u golang.org/x/tools -v
# cd .; git clone https://go.googlesource.com/tools /home/pmensik/go/src/golang.org/x/tools
Cloning into '/home/pmensik/go/src/golang.org/x/tools'...
fatal: unable to connect to go.googlesource.com:
go.googlesource.com[0: 2a00:1450:400c:c0a::52]: errno=Connection timed out
go.googlesource.com[1: 173.194.76.82]: errno=Connection timed out

package golang.org/x/tools: exit status 128
package -v: unrecognized import path "-v" (import path does not begin with hostname)

Basically the same is for git clone . git clone基本相同。

I also tried to authenticate via .gitcookie file generated on go.googlesource.com but it didn't help as well.我还尝试通过在.gitcookie生成的.gitcookie文件进行身份验证,但也无济于事。 I can clone any other repositories and I don't experience any other network problem.我可以克隆任何其他存储库,并且我没有遇到任何其他网络问题。

My platform is elementaryOS Loki based on Ubuntu 16.02, I am not using VPN or any proxies.我的平台是基于 Ubuntu 16.02 的 elementOS Loki,我没有使用 VPN 或任何代理。 go env says the following go env说以下内容

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/pmensik/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/pmensik/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build729564191=/tmp/go-build -gno-record-gcc-switches"

So what could be wrong?那么可能有什么问题呢?

I finally solved it with downloading all the stuff all need in a virtual machine.我终于通过在虚拟机中下载所有需要的东西来解决它。 I am still not sure why it doesn't work on my host machine.我仍然不确定为什么它在我的主机上不起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM