gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 01:57:02 25 4
gpt4 key购买 nike

设置代理之前:

$ 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.)

设置代理后:

$ 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)

我已经尝试了在 StackOverflow 上可以找到的所有解决方案。我仍然无法解决这个问题。

$ 去环境

$ 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

我该如何解决?

最佳答案

始终将您的 HTTP_PROXY 和 HTTPS_PROXY 设置为 http URL

代理本身应该通过http访问,即使你的URL查询是https

关于升级到 go 1.10 后 go get 失败,导入路径无法识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50616909/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com