当前位置:   article > 正文

golang 配置代理。_golang 设置代理

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"
  • 1
  • 2
  • 3
  • 4

Linux / Mac。

# 设置 goproxy.io 代理。
export GOPROXY=https://goproxy.io
# 设置 GO111MOUDLE。
export GO111MODULE=on 
  • 1
  • 2
  • 3
  • 4
> 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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/890172
推荐阅读
相关标签
  

闽ICP备14008679号