stack-labs / questions

任何关于Micro的问题都可以在Issue中创建
27 stars 6 forks source link

tutorials/examples/micro-api/api/ 示例生成proto文件不成功 #66

Open cooldog21 opened 4 years ago

cooldog21 commented 4 years ago

protoc --proto_path=${GOPATH}/src:. --go_out=. --micro_out=. proto/api.proto (master)

github.com/micro/go-micro/v2/api/proto/api.proto: File not found. proto/api.proto:3:1: Import "github.com/micro/go-micro/v2/api/proto/api.proto" was not found or had errors.

cooldog21 commented 4 years ago

1、偷机的方法:把api.proto软链到其他目录,并加入到 proto_path... 2、README.md文件中的protoc --proto_path=${GOPATH}/src:. --go_out=. --micro_out=Mgithub.com/micro/go-micro/api/proto/api.proto=github.com/micro/go-micro/v2/api/proto:. api/api.proto api/api.proto需要改为 proto/api.proto