专注于 JetBrains IDEA 全家桶,永久激活,教程
持续更新 PyCharm,IDEA,WebStorm,PhpStorm,DataGrip,RubyMine,CLion,AppCode 永久激活教程

go mod包管理 加代理下载

原始go.mod文件

module xxx

go 1.14

报错 i/o timeout

go mod init workorder
go mod init: go.mod already exists

go mod tidy
go: finding module for package github.com/greyh4t/zhttp
go: finding module for package github.com/tidwall/gjson
go: finding module for package github.com/deckarep/golang-set
workorder imports
        github.com/deckarep/golang-set: module github.com/deckarep/golang-set: Get "https://proxy.golang.org/github.com/deckarep/golang-set/@v/list": dial tcp 34.64.4.81:443: i/o timeout
workorder imports
        github.com/greyh4t/zhttp: module github.com/greyh4t/zhttp: Get "https://proxy.golang.org/github.com/greyh4t/zhttp/@v/list": dial tcp 34.64.4.81:443: i/o timeout
workorder imports
        github.com/tidwall/gjson: module github.com/tidwall/gjson: Get "https://proxy.golang.org/github.com/tidwall/gjson/@v/list": dial tcp 34.64.4.81:443: i/o timeout

加代理

➜  ~ vim ./.zshrc

export GO111MODULE=on
export GOPROXY=https://goproxy.io

➜  ~ . ./.zshrc

然后在运行一次:go mod tidy

加载后的go.mod文件

module xxx

go 1.14

require (
    github.com/deckarep/golang-set v1.7.1
    github.com/greyh4t/zhttp v0.0.0-20200602035456-2186ce915b30
    github.com/stretchr/testify v1.6.1 // indirect
    github.com/tidwall/gjson v1.6.0
)

参考

https://blog.csdn.net/dgatiger/article/details/105205190
https://blog.csdn.net/zzhongcy/article/details/97243826

文章永久链接:https://tech.souyunku.com/22075

未经允许不得转载:搜云库技术团队 » go mod包管理 加代理下载

JetBrains 全家桶,激活、破解、教程

提供 JetBrains 全家桶激活码、注册码、破解补丁下载及详细激活教程,支持 IntelliJ IDEA、PyCharm、WebStorm 等工具的永久激活。无论是破解教程,还是最新激活码,均可免费获得,帮助开发者解决常见激活问题,确保轻松破解并快速使用 JetBrains 软件。获取免费的破解补丁和激活码,快速解决激活难题,全面覆盖 2024/2025 版本!

联系我们联系我们