golang 配置代理。

golang 配置代理。

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.1
go: downloading github.com/gin-contrib/sse v0.1.0
go: downloading github.com/mattn/go-isatty v0.0.19
go: downloading golang.org/x/net v0.10.0
go: downloading github.com/bytedance/sonic v1.9.1
go: downloading github.com/goccy/go-json v0.10.2
go: downloading github.com/json-iterator/go v1.1.12
go: downloading github.com/pelletier/go-toml/v2 v2.0.8
go: downloading github.com/ugorji/go/codec v1.2.11
go: downloading google.golang.org/protobuf v1.30.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/go-playground/validator/v10 v10.14.0
go: downloading github.com/pelletier/go-toml v1.9.5
go: downloading github.com/bytedance/sonic v1.9.2
go: downloading golang.org/x/sys v0.8.0
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/ugorji/go v1.2.11
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading golang.org/x/net v0.11.0
go: downloading github.com/go-playground/validator/v10 v10.14.1
go: downloading google.golang.org/protobuf v1.31.0
go: downloading github.com/go-playground/validator v9.31.0+incompatible
go: downloading github.com/gabriel-vasile/mimetype v1.4.2
go: downloading github.com/go-playground/universal-translator v0.18.1
go: downloading github.com/leodido/go-urn v1.2.4
go: downloading golang.org/x/crypto v0.9.0
go: downloading golang.org/x/text v0.9.0
go: downloading golang.org/x/sys v0.9.0
go: downloading golang.org/x/arch v0.3.0
go: downloading github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311
go: downloading golang.org/x/crypto v0.10.0
go: downloading github.com/go-playground/locales v0.14.1
go: downloading golang.org/x/text v0.10.0
go: downloading github.com/twitchyliquid64/golang-asm v0.15.1
go: downloading github.com/klauspost/cpuid/v2 v2.2.4
go: downloading github.com/klauspost/cpuid/v2 v2.2.5
go: downloading github.com/klauspost/cpuid v1.3.1
go: added github.com/bytedance/sonic v1.9.2
go: added github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311
go: added github.com/gabriel-vasile/mimetype v1.4.2
go: added github.com/gin-contrib/sse v0.1.0
go: added github.com/gin-gonic/gin v1.9.1
go: added github.com/go-playground/locales v0.14.1
go: added github.com/go-playground/universal-translator v0.18.1
go: added github.com/go-playground/validator/v10 v10.14.1
go: added github.com/goccy/go-json v0.10.2
go: added github.com/json-iterator/go v1.1.12
go: added github.com/klauspost/cpuid/v2 v2.2.5
go: added github.com/leodido/go-urn v1.2.4
go: added github.com/mattn/go-isatty v0.0.19
go: added github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: added github.com/modern-go/reflect2 v1.0.2
go: added github.com/pelletier/go-toml/v2 v2.0.8
go: added github.com/twitchyliquid64/golang-asm v0.15.1
go: added github.com/ugorji/go/codec v1.2.11
go: added golang.org/x/arch v0.3.0
go: added golang.org/x/crypto v0.10.0
go: added golang.org/x/net v0.11.0
go: added golang.org/x/sys v0.9.0
go: added golang.org/x/text v0.10.0
go: added google.golang.org/protobuf v1.31.0
go: added gopkg.in/yaml.v3 v3.0.1

你可能感兴趣的:(golang,开发语言,后端)