dongmufen8105 2019-03-01 15:48
浏览 124

go命令“ go get”给出了无法识别的导入路径错误

I am working on RHEL7 and trying to download dependency https://gopkg.in/yaml.v2

My go version is go1.12 linux/amd64 and go env is:

`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"`

and when I try to run the command:

 `go get -v -u -insecure gopkg.in/yaml.v2`

It gave me following error: 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)

Also I able to run go get any package from github.com e.g. go get github.com/mattn/go-sqlite3 works just fine. I am able to do curl -k https://gopkg.in/yaml.v2 and this return me the html page and confirms that connection is established from my VM to gopkg.in. Can anyone please tell what I am missing. Let me know if you need more info

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏