Skip to content

Commit 755a87c

Browse files
authored
Create go安装环境配置.md
1 parent 9a47228 commit 755a87c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

go安装环境配置.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## 用法
2+
3+
虽然下面的内容主要是讲解如何设置 GOPROXY,但是我们也推荐你在使用 Go 模块时将 GO111MODULE 设置为 on 而不是 auto。
4+
5+
### Go 1.13 及以上(推荐)
6+
打开你的终端并执行:
7+
8+
> $ go env -w GOPROXY=https://goproxy.cn,direct
9+
10+
完成。
11+
12+
### macOS 或 Linux
13+
打开你的终端并执行:
14+
15+
> $ export GOPROXY=https://goproxy.cn
16+
17+
或者
18+
19+
> $ echo "export GOPROXY=https://goproxy.cn" >> ~/.profile && source ~/.profile
20+
21+
完成。
22+
23+
### Windows
24+
打开你的 PowerShell 并执行:
25+
26+
> C:\> $env:GOPROXY = "https://goproxy.cn"
27+
28+
或者
29+
30+
1. 打开“开始”并搜索“env”
31+
2. 选择“编辑系统环境变量”
32+
3. 点击“环境变量…”按钮
33+
4. 在“<你的用户名> 的用户变量”章节下(上半部分)
34+
5. 点击“新建…”按钮
35+
6. 选择“变量名”输入框并输入“GOPROXY”
36+
7. 选择“变量值”输入框并输入“https://goproxy.cn”
37+
8. 点击“确定”按钮
38+
39+
完成。

0 commit comments

Comments
 (0)