From 7cc64070b12be12fe5dd3aacdd216b953595f96f Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sun, 2 Jan 2022 14:31:31 +0800 Subject: [PATCH] docs: update goctl installation command (#1403) --- readme-cn.md | 4 ++-- readme.md | 4 ++-- tools/goctl/upgrade/upgrade.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/readme-cn.md b/readme-cn.md index d92fa2a3..db30c6ff 100644 --- a/readme-cn.md +++ b/readme-cn.md @@ -104,10 +104,10 @@ GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/ ```shell # 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 及以后版本 - 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 可执行 diff --git a/readme.md b/readme.md index ab346ea8..5701e283 100644 --- a/readme.md +++ b/readme.md @@ -107,10 +107,10 @@ go get -u github.com/tal-tech/go-zero ```shell # 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 - 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. diff --git a/tools/goctl/upgrade/upgrade.go b/tools/goctl/upgrade/upgrade.go index 7af62cab..5246388b 100644 --- a/tools/goctl/upgrade/upgrade.go +++ b/tools/goctl/upgrade/upgrade.go @@ -9,11 +9,11 @@ import ( ) // 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 { - 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" { - 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, "") if err != nil {