Skip to content

Commit

Permalink
chore: update docs for goproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan committed Jan 29, 2025
1 parent d23a3e9 commit 64b3dcb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 31 deletions.
32 changes: 11 additions & 21 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,37 @@ Go 官网概括如下:
## 1. 下载

:::note 注意
这里以 `1.19.4` 版本为例子,并 **不推荐** 安装具体版本,开发者可根据需要自行选择,更多版本可前往 [前往官网](https://go.dev/dl/) 自行选择。
这里以 `1.23.5` 版本为例子,并 **不推荐** 安装具体版本,开发者可根据需要自行选择,更多版本可前往 [前往官网](https://go.dev/dl/) 自行选择。
:::

<DocsCards>

<DocsCard
header="Microsoft Windows"
href="https://go.dev/dl/go1.19.4.windows-amd64.msi" >
href="https://go.dev/dl/go1.23.5.windows-amd64.msi" >
<p>支持 Windows 7 及以后,Intel 64 位处理器</p>
<a>go1.19.4.windows-amd64.msi(135MB)</a>
<a>go1.23.5.windows-amd64.msi</a>
</DocsCard>

<DocsCard
header="Apple macOS(ARM64)"
href="https://go.dev/dl/go1.19.4.darwin-arm64.pkg" >
href="https://go.dev/dl/go1.23.5.darwin-arm64.pkg" >
<p>支持 macOS 11 及以后,Apple 64 位处理器</p>
<a>go1.19.4.darwin-arm64.pkg(139MB)</a>
<a>go1.23.5.darwin-arm64.pkg</a>
</DocsCard>

<DocsCard
header="Apple macOS(x86-64)"
href="https://go.dev/dl/go1.19.4.darwin-amd64.pkg" >
href="https://go.dev/dl/go1.23.5.darwin-amd64.pkg" >
<p>支持 macOS 10.13 及以后,64 位处理器</p>
<a>go1.19.4.darwin-amd64.pkg(145MB)</a>
<a>go1.23.5.darwin-amd64.pkg</a>
</DocsCard>

<DocsCard
header="Linux"
href="https://go.dev/dl/go1.19.4.linux-amd64.tar.gz" >
href="https://go.dev/dl/go1.23.5.linux-amd64.tar.gz" >
<p>支持 Linux 2.6.32 及以后,Intel 64 位处理器</p>
<a>go1.19.4.linux-amd64.tar.gz(142MB)</a>
<a>go1.23.5.linux-amd64.tar.gz</a>
</DocsCard>

</DocsCards>
Expand Down Expand Up @@ -128,25 +128,15 @@ href="https://go.dev/dl/go1.19.4.linux-amd64.tar.gz" >

## 3. 配置

### 3.1 GO111MODULE 开启

在 go 1.11 以后建议将 `GO111MODULE` 值显式设置为 `on`,以免后续拉取依赖出现一些不必要的错误。

```bash
$ go env -w GO111MODULE=on
```

### 3.2 配置 Proxy
### 3.1 配置 Proxy

```bash
$ go env -w GOPROXY=https://goproxy.cn,direct
```

### 3.3 查看配置
### 3.2 查看配置

```bash
$ go env GO111MODULE
on
$ go env GOPROXY
https://goproxy.cn,direct
```
Expand Down
5 changes: 3 additions & 2 deletions docs/tasks/installation/go-zero.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ $ go get -u github.com/zeromicro/go-zero@latest

### 1. 设置了 GOPROXY 后,依赖还是拉不下来?

确认 `GO111MODULE` 是否开启
确保设置 `GOPROXY` 的方式是正确的,并通过 `go env GOPROXY` 命令确认设置成功,如下:

```shell
$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.cn,direct
$ go env GOPROXY
https://goproxy.cn,direct
```
8 changes: 0 additions & 8 deletions docs/tasks/installation/goctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ $ go version

### 1.2. go [get, install]

- 如果 go 版本在 `1.16` 以前,则使用如下命令安装:

```bash
$ GO111MODULE=on go get -u github.com/zeromicro/go-zero/tools/goctl@latest
```

- 如果 go 版本在 `1.16` 及以后,则使用如下命令安装:

```bash
$ go install github.com/zeromicro/go-zero/tools/goctl@latest
```
Expand Down

0 comments on commit 64b3dcb

Please sign in to comment.