按文档的方式生成user.proto文件,然后使用goctl rpc proto -src user.proto -dir .命令生成桩代码会出现如下错误:
protoc --proto_path=E:\go_work\src\go-zero\mall\user\rpc user.proto --go_out=plugins=grpc:E:\go_work\src\go-zero\mall\user\rpc\user --go_opt=Muser.proto=.
goctl: generation error: protoc-gen-go: invalid Go import path "." for "user.proto"
The import path must contain at least one forward slash ('/') character.
See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.
--go_out: protoc-gen-go: Plugin failed with status code 1.
goctl version: 1.2.3 windows/amd64
系统环境 : windows 10 x64 golang version : 1.17.0 goctl version: 1.2.3 windows/amd64 文档错误url: https://go-zero.dev/cn/micro-service.html https://go-zero.dev/cn/goctl-rpc.html
按文档的方式生成
user.proto
文件,然后使用goctl rpc proto -src user.proto -dir .
命令生成桩代码会出现如下错误:解决办法:
将proto文件中的
修改为