发布时间:2025-12-10 19:30:08 浏览次数:13
golang配置代理_vim golanggo:modulegithub.com/gin-gonic/gin:Get”https://proxy.golang.org/github.com/gin-gonic/gin/@v/list”:dialtcp142.251.42.241:443:connectex:Aconnectionattemptfailedbecausetheconnectedpartydidnotproperlyrespondafteraperiodoftime,orestabl_go代理
go: module github.com/gin-gonic/gin: Get “https://proxy.golang.org/github.com/gin-gonic/gin/@v/list”: dial tcp 142.251.42.241:443: connectex: 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.
解决。
Windows。
# 设置 goproxy.io 代理。go env -w GOPROXY="https://goproxy.io"# 设置 GO111MOUDLE。go env -w GO111MODULE="on"希望我今天分享的这篇文章可以帮到您。
Linux / Mac。
# 设置 goproxy.io 代理。export GOPROXY=https://goproxy.io# 设置 GO111MOUDLE。export GO111MODULE=on > go get -u github.com/gin-gonic/gin go: downloading github.com/gin-gonic/gin v1.9.1go: downloading github.com/gin-contrib/sse v0.1.0go: downloading github.com/mattn/go-isatty v0.0.19go: downloading golang.org/x/net v0.10.0go: downloading github.com/bytedance/sonic v1.9.1go: downloading github.com/goccy/go-json v0.10.2go: downloading github.com/json-iterator/go v1.1.12go: downloading github.com/pelletier/go-toml/v2 v2.0.8go: downloading github.com/ugorji/go/codec v1.2.11go: downloading google.golang.org/protobuf v1.30.0go: downloading gopkg.in/yaml.v3 v3.0.1go: downloading github.com/go-playground/validator/v10 v10.14.0go: downloading github.com/pelletier/go-toml v1.9.5go: downloading github.com/bytedance/sonic v1.9.2go: downloading golang.org/x/sys v0.8.0go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1ddgo: downloading github.com/ugorji/go v1.2.11go: downloading github.com/modern-go/reflect2 v1.0.2go: downloading golang.org/x/net v0.11.0go: downloading github.com/go-playground/validator/v10 v10.14.1go: downloading google.golang.org/protobuf v1.31.0go: downloading github.com/go-playground/validator v9.31.0+incompatiblego: downloading github.com/gabriel-vasile/mimetype v1.4.2go: downloading github.com/go-playground/universal-translator v0.18.1go: downloading github.com/leodido/go-urn v1.2.4go: downloading golang.org/x/crypto v0.9.0go: downloading golang.org/x/text v0.9.0go: downloading golang.org/x/sys v0.9.0go: downloading golang.org/x/arch v0.3.0go: downloading github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311go: downloading golang.org/x/crypto v0.10.0go: downloading github.com/go-playground/locales v0.14.1go: downloading golang.org/x/text v0.10.0go: downloading github.com/twitchyliquid64/golang-asm v0.15.1go: downloading github.com/klauspost/cpuid/v2 v2.2.4go: downloading github.com/klauspost/cpuid/v2 v2.2.5go: downloading github.com/klauspost/cpuid v1.3.1go: added github.com/bytedance/sonic v1.9.2go: added github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311go: added github.com/gabriel-vasile/mimetype v1.4.2go: added github.com/gin-contrib/sse v0.1.0go: added github.com/gin-gonic/gin v1.9.1go: added github.com/go-playground/locales v0.14.1go: added github.com/go-playground/universal-translator v0.18.1go: added github.com/go-playground/validator/v10 v10.14.1go: added github.com/goccy/go-json v0.10.2go: added github.com/json-iterator/go v1.1.12go: added github.com/klauspost/cpuid/v2 v2.2.5go: added github.com/leodido/go-urn v1.2.4go: added github.com/mattn/go-isatty v0.0.19go: added github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1ddgo: added github.com/modern-go/reflect2 v1.0.2go: added github.com/pelletier/go-toml/v2 v2.0.8go: added github.com/twitchyliquid64/golang-asm v0.15.1go: added github.com/ugorji/go/codec v1.2.11go: added golang.org/x/arch v0.3.0go: added golang.org/x/crypto v0.10.0go: added golang.org/x/net v0.11.0go: added golang.org/x/sys v0.9.0go: added golang.org/x/text v0.10.0go: added google.golang.org/protobuf v1.31.0go: added gopkg.in/yaml.v3 v3.0.1