duanpiangeng8958 2018-05-31 04:58
浏览 132
已采纳

升级到1.10后,go get失败,导入路径无法识别

Before setting proxy:

$ go get -u google.golang.org/grpc

package google.golang.org/grpc: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial TCP 172.217.160.145:443: connected: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

After setting proxy:

$ go get -u google.golang.org/grpc

package google.golang.org/grpc: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: proxyconnect tcp: EOF)

I have tried every solution I could find on StackOverflow. I am still not able to solve this issue.

$ go env

$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\gayr\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\gayr\GolandProjects
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\gayr\AppData\Local\Temp\go-build135172366=/tmp/go-build -gno-record-gcc-switches

How can I resolve this?

  • 写回答

1条回答 默认 最新

  • doulangyu9636 2018-05-31 05:18
    关注

    Always set your HTTP_PROXY and HTTPS_PROXY to an http URL

    The proxy itself should be accessed through http, even if your URL query is https

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?