docs: update goctl installation command (#1403)

This commit is contained in:
Kevin Wan
2022-01-02 14:31:31 +08:00
committed by GitHub
parent c19d2637ea
commit 7cc64070b1
3 changed files with 7 additions and 7 deletions

View File

@@ -104,10 +104,10 @@ GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/
```shell ```shell
# Go 1.15 及之前版本 # Go 1.15 及之前版本
GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/go-zero/tools/goctl@cli GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/go-zero/tools/goctl@latest
# Go 1.16 及以后版本 # Go 1.16 及以后版本
GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@cli GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@latest
``` ```
确保 goctl 可执行 确保 goctl 可执行

View File

@@ -107,10 +107,10 @@ go get -u github.com/tal-tech/go-zero
```shell ```shell
# for Go 1.15 and earlier # for Go 1.15 and earlier
GO111MODULE=on go get -u github.com/tal-tech/go-zero/tools/goctl@cli GO111MODULE=on go get -u github.com/tal-tech/go-zero/tools/goctl@latest
# for Go 1.16 and later # for Go 1.16 and later
go install github.com/tal-tech/go-zero/tools/goctl@cli go install github.com/tal-tech/go-zero/tools/goctl@latest
``` ```
make sure goctl is executable. make sure goctl is executable.

View File

@@ -9,11 +9,11 @@ import (
) )
// Upgrade gets the latest goctl by // Upgrade gets the latest goctl by
// go get -u github.com/tal-tech/go-zero/tools/goctl // go install github.com/tal-tech/go-zero/tools/goctl@latest
func Upgrade(_ *cli.Context) error { func Upgrade(_ *cli.Context) error {
cmd := `GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@cli` cmd := `GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@latest`
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
cmd = `set GOPROXY=https://goproxy.cn,direct && go install github.com/tal-tech/go-zero/tools/goctl@cli` cmd = `set GOPROXY=https://goproxy.cn,direct && go install github.com/tal-tech/go-zero/tools/goctl@latest`
} }
info, err := execx.Run(cmd, "") info, err := execx.Run(cmd, "")
if err != nil { if err != nil {