0


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。

  1. # 设置 goproxy.io 代理。
  2. go env -w GOPROXY="https://goproxy.io"# 设置 GO111MOUDLE。
  3. go env -w GO111MODULE="on"

Linux / Mac。

  1. # 设置 goproxy.io 代理。exportGOPROXY=https://goproxy.io
  2. # 设置 GO111MOUDLE。exportGO111MODULE=on
  1. > go get -u github.com/gin-gonic/gin
  2. go: downloading github.com/gin-gonic/gin v1.9.1
  3. go: downloading github.com/gin-contrib/sse v0.1.0
  4. go: downloading github.com/mattn/go-isatty v0.0.19
  5. go: downloading golang.org/x/net v0.10.0
  6. go: downloading github.com/bytedance/sonic v1.9.1
  7. go: downloading github.com/goccy/go-json v0.10.2
  8. go: downloading github.com/json-iterator/go v1.1.12
  9. go: downloading github.com/pelletier/go-toml/v2 v2.0.8
  10. go: downloading github.com/ugorji/go/codec v1.2.11
  11. go: downloading google.golang.org/protobuf v1.30.0
  12. go: downloading gopkg.in/yaml.v3 v3.0.1
  13. go: downloading github.com/go-playground/validator/v10 v10.14.0
  14. go: downloading github.com/pelletier/go-toml v1.9.5
  15. go: downloading github.com/bytedance/sonic v1.9.2
  16. go: downloading golang.org/x/sys v0.8.0
  17. go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
  18. go: downloading github.com/ugorji/go v1.2.11
  19. go: downloading github.com/modern-go/reflect2 v1.0.2
  20. go: downloading golang.org/x/net v0.11.0
  21. go: downloading github.com/go-playground/validator/v10 v10.14.1
  22. go: downloading google.golang.org/protobuf v1.31.0
  23. go: downloading github.com/go-playground/validator v9.31.0+incompatible
  24. go: downloading github.com/gabriel-vasile/mimetype v1.4.2
  25. go: downloading github.com/go-playground/universal-translator v0.18.1
  26. go: downloading github.com/leodido/go-urn v1.2.4
  27. go: downloading golang.org/x/crypto v0.9.0
  28. go: downloading golang.org/x/text v0.9.0
  29. go: downloading golang.org/x/sys v0.9.0
  30. go: downloading golang.org/x/arch v0.3.0
  31. go: downloading github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311
  32. go: downloading golang.org/x/crypto v0.10.0
  33. go: downloading github.com/go-playground/locales v0.14.1
  34. go: downloading golang.org/x/text v0.10.0
  35. go: downloading github.com/twitchyliquid64/golang-asm v0.15.1
  36. go: downloading github.com/klauspost/cpuid/v2 v2.2.4
  37. go: downloading github.com/klauspost/cpuid/v2 v2.2.5
  38. go: downloading github.com/klauspost/cpuid v1.3.1
  39. go: added github.com/bytedance/sonic v1.9.2
  40. go: added github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311
  41. go: added github.com/gabriel-vasile/mimetype v1.4.2
  42. go: added github.com/gin-contrib/sse v0.1.0
  43. go: added github.com/gin-gonic/gin v1.9.1
  44. go: added github.com/go-playground/locales v0.14.1
  45. go: added github.com/go-playground/universal-translator v0.18.1
  46. go: added github.com/go-playground/validator/v10 v10.14.1
  47. go: added github.com/goccy/go-json v0.10.2
  48. go: added github.com/json-iterator/go v1.1.12
  49. go: added github.com/klauspost/cpuid/v2 v2.2.5
  50. go: added github.com/leodido/go-urn v1.2.4
  51. go: added github.com/mattn/go-isatty v0.0.19
  52. go: added github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
  53. go: added github.com/modern-go/reflect2 v1.0.2
  54. go: added github.com/pelletier/go-toml/v2 v2.0.8
  55. go: added github.com/twitchyliquid64/golang-asm v0.15.1
  56. go: added github.com/ugorji/go/codec v1.2.11
  57. go: added golang.org/x/arch v0.3.0
  58. go: added golang.org/x/crypto v0.10.0
  59. go: added golang.org/x/net v0.11.0
  60. go: added golang.org/x/sys v0.9.0
  61. go: added golang.org/x/text v0.10.0
  62. go: added google.golang.org/protobuf v1.31.0
  63. go: added gopkg.in/yaml.v3 v3.0.1

本文转载自: https://blog.csdn.net/lyfGeek/article/details/131447267
版权归原作者 lyfGeek 所有, 如有侵权,请联系我们删除。

“golang 配置代理。”的评论:

还没有评论