• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang加速Gomodule加速Goproxy

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

The most trusted Go module proxy in China.

https://goproxy.cn

Go 1.13 and above (RECOMMENDED)

Open your terminal and execute

$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.cn,direct

done.

macOS or Linux

Open your terminal and execute

$ export GO111MODULE=on
$ export GOPROXY=https://goproxy.cn

or

$ echo "export GO111MODULE=on" >> ~/.profile
$ echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
$ source ~/.profile

done.

Windows

Open your terminal and execute

C:\> $env:GO111MODULE = "on"
C:\> $env:GOPROXY = "https://goproxy.cn"

or

1. Open the Start Search, type in "env"
2. Choose the "Edit the system environment variables"
3. Click the "Environment Variables…" button
4. Under the "User variables for <YOUR_USERNAME>" section (the upper half)
5. Click the "New..." button
6. Choose the "Variable name" input bar, type in "GO111MODULE"
7. Choose the "Variable value" input bar, type in "on"
8. Click the "OK" button
9. Click the "New..." button
10. Choose the "Variable name" input bar, type in "GOPROXY"
11. Choose the "Variable value" input bar, type in "https://goproxy.cn"
12. Click the "OK" button

done.


goproxy.io

https://goproxy.io

A Global Proxy for Go Modules

Go version >= 1.13 (RECOMMENDED)

go env -w GO111MODULE=on
go env -w GOPROXY="https://goproxy.io,direct"

# Set environment variable allow bypassing the proxy for selected modules (optional)
go env -w GOPRIVATE="*.corp.example.com"

# Set environment variable allow bypassing the proxy for specified organizations (optional)
go env -w GOPRIVATE="example.com/org_name"

Now, when you build your applications, Go will fetch dependencies via goproxy.io. See more information in the doc and how to use Private service.

Go version <= 1.12

Bash (Linux or macOS)

# Enable the go modules feature
export GO111MODULE="on"
# Set the GOPROXY environment variable
export GOPROXY="https://goproxy.io"

Or, write it into the .profile or .bash_profile file.

PowerShell (Windows)

# Enable the go modules feature
$env:GO111MODULE="on"
# Set the GOPROXY environment variable
$env:GOPROXY="https://goproxy.io"

Now, when you build your applications, Go will fetch dependencies via goproxy.io. See more information in the doc.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
go安装配置Win10下安装Go开发环境发布时间:2022-07-10
下一篇:
go时间戳和时间格式的相互转换发布时间:2022-07-10
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap