我正在使用RHEL7,并尝试下载依赖项 https://gopkg.in/yaml.v2
我的go版本是go1.12 linux/amd64
而去环境是:
`GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ash/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ash/GoWork/src/prj"
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-build314905315=/tmp/go-build -gno-record-gcc-switches"`
以及当我尝试运行命令时:
`go get -v -u -insecure gopkg.in/yaml.v2`
它给了我以下错误:
Fetching https://gopkg.in/yaml.v2?go-get=1 https fetch failed: Get https://gopkg.in/yaml.v2?go-get=1: proxyconnect tcp: read tcp 10.xxx.xxx.xxx:46884->10.xxx.xxx.xxx:8080: read: connection reset by peer Fetching http://gopkg.in/yaml.v2?go-get=1 package gopkg.in/yaml.v2: unrecognized import path "gopkg.in/yaml.v2" (http/https fetch: Get http://gopkg.in/yaml.v2?go-get=1: proxyconnect tcp: read tcp 10.xxx.xxx.xxx:46886->10.xxx.xxx.xxx:8080: read: connection reset by peer)
我也可以运行从github.com获取任何软件包,例如go get github.com/mattn/go-sqlite3
可以正常工作。
我可以执行curl -k https://gopkg.in/yaml.v2
,这将返回html页面,并确认已建立从我的VM到gopkg.in的连接。谁能告诉我我所缺少的。让我知道您是否需要更多信息