[zeromicro/go-zero]gctl new同样目录下两次执行不同结果,生成错误文件目录

2024-03-18 867 views
0

执行命令cmd,及log ` G:\go\src\kispr\greet 的目录

2020/10/25 16:13

. 2020/10/25 16:13 .. 0 个文件 0 字节 2 个目录 307,307,012,096 可用字节

G:\go\src\kispr\greet>dir 驱动器 G 中的卷是 新加卷 卷的序列号是 AA02-EC66

G:\go\src\kispr\greet 的目录

2020/10/25 16:13

. 2020/10/25 16:13 .. 2020/10/25 16:12 etc 2020/10/25 16:13 67 go.mod 2020/10/25 16:13 35,166 go.sum 2020/10/25 16:12 272 greet.api 2020/10/25 16:12 586 greet.go 2020/10/25 16:12 internal 4 个文件 36,091 字节 4 个目录 307,307,012,096 可用字节

G:\go\src\kispr\greet>G:\go\bin\goctl api new greet Done.

G:\go\src\kispr\greet>G:\go\bin\goctl api go -api greet.api -dir . error: near line: 15, wrong line "get /greet/from/:name(Request) returns ( );", "route syntax: [get/post/delete] /path(request) returns[(response)]"

G:\go\src\kispr\greet>G:\go\bin\goctl -api greet.api -dir . Incorrect Usage. flag provided but not defined: -api

NAME: goctl - a cli tool to generate code

USAGE: goctl [global options] command [command options] [arguments...]

VERSION: 20201021 windows/amd64

COMMANDS: api generate api related files docker generate Dockerfile and Makefile rpc generate rpc code model generate model code config generate config json template template operation help, h Shows a list of commands or help for one command

GLOBAL OPTIONS: --help, -h show help --version, -v print the version error: flag provided but not defined: -api

G:\go\src\kispr\greet>G:\go\bin\goctl api go -api greet.api error: missing -dir

G:\go\src\kispr\greet>G:\go\bin\goctl api go -api greet.api -dir . error: near line: 15, wrong line "get /greet/from/:name(Request) returns ( );", "route syntax: [get/post/delete] /path(request) returns[(response)]"

G:\go\src\kispr\greet>G:\go\bin\goctl -api greet.api -dir . Incorrect Usage. flag provided but not defined: -api

NAME: goctl - a cli tool to generate code

USAGE: goctl [global options] command [command options] [arguments...]

VERSION: 20201021 windows/amd64

COMMANDS: api generate api related files docker generate Dockerfile and Makefile rpc generate rpc code model generate model code config generate config json template template operation help, h Shows a list of commands or help for one command

GLOBAL OPTIONS: --help, -h show help --version, -v print the version error: flag provided but not defined: -api

G:\go\src\kispr\greet>G:\go\bin\goctl api go -dir . error: missing -api

G:\go\src\kispr\greet>G:\go\bin\goctl api new greet G:\go\src\kispr\greet\greet/etc/greet-api.yaml exists, ignored generation G:\go\src\kispr\greet\greet/internal/config/config.go exists, ignored generation

G:\go\src\kispr\greet\greet/greet.go exists, ignored generation G:\go\src\kispr\greet\greet/internal/svc/servicecontext.go exists, ignored gener ation G:\go\src\kispr\greet\greet/internal/types/types.go exists, ignored generation G:\go\src\kispr\greet\greet/internal/handler/greethandler.go exists, ignored gen eration G:\go\src\kispr\greet\greet/internal/handler/routes.go exists, ignored generatio n G:\go\src\kispr\greet\greet/internal/logic/greetlogic.go exists, ignored generat ion Done.

G:\go\src\kispr\greet>`

回答

7

[Uploading gctl.log…]()

8

执行第二次gctl new命令后生成目录: ' Microsoft Windows [版本 6.1.7601] 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>G: 'G:' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

C:\Users\Administrator>G:

G:>cd G:\go\src\kispr\greet\

G:\go\src\kispr\greet>dir 驱动器 G 中的卷是 新加卷 卷的序列号是 AA02-EC66

G:\go\src\kispr\greet 的目录

2020/10/25 17:43

. 2020/10/25 17:43 .. 2020/10/25 17:41 .idea 2020/10/25 17:38 etc 2020/10/25 16:13 67 go.mod 2020/10/25 16:13 35,166 go.sum 2020/10/25 17:24 13,605,888 go_build_greet_go.exe 2020/10/25 17:43 greet 2020/10/25 17:43 327 greet.api 2020/10/25 17:16 639 greet.go 2020/10/25 16:55 internal 5 个文件 13,642,087 字节 6 个目录 307,293,380,608 可用字节

G:\go\src\kispr\greet> '

4

你两次执行的根目录是不是都是在 go\src\kispr\greet 下面?