goctl的1.2.3版本使用goctl migrate無法升級到1.3.0版本記錄

jsonMark發表於2022-02-08
  D:\Tools\Go\Code\src\go-slot>goctl migrate --verbose --version v1.3.0
  No help topic for 'migrate'

  D:\Tools\Go\Code\src\go-slot>goctl -v
  goctl version 1.2.3-cli windows/amd64

  D:\Tools\Go\Code\src\go-slot>go install github.com/zeromicro/go-zero/tools/goctl@v1.3.0
  go install: github.com/zeromicro/go-zero/tools/goctl@v1.3.0: module github.com/zeromicro/go-zero@v1.3.0 found, but does not contain package github.com/zeromicro/go-zero/tools/goctl

  D:\Tools\Go\Code\src\go-slot>go install github.com/zeromicro/go-zero/tools/goctl@latest
  go: downloading github.com/zeromicro/go-zero/tools/goctl v1.3.1
  go: downloading github.com/zeromicro/go-zero v1.3.0-beta
  go: downloading github.com/lib/pq v1.10.4

操作截圖:
操作截圖

如果執行下面命令

goctl migrate —version v1.3.0

出現以下提示:

No help topic for 'migrate'

正確姿勢(go版本1.16以上使用go install ,之前版本使用go get -u):
第1步:去gobin或者gopath/bin下面手動刪除goctl.exe,
第2步:使用如下命令來更新goctl工具

go install github.com/zeromicro/go-zero/tools/goctl@latest

錯誤姿勢:

go install github.com/zeromicro/go-zero/tools/goctl@v1.3.0
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章