Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logic/grpc/api.proto编译失败,请教一下如何配置才能编译成功 #332

Open
liming127 opened this issue Apr 30, 2020 · 5 comments

Comments

@liming127
Copy link

protoc api.proto --go_out=./ --proto_path=../../comet/grpc:$GOPATH/src/github.com/gogo/protobuf/gogoproto/:$GOPATH/src/google/protobuf/
github.com/gogo/protobuf/gogoproto/gogo.proto: File not found.
api.proto:6:1: Import "github.com/gogo/protobuf/gogoproto/gogo.proto" was not found or had errors.

@tonybase
Copy link
Collaborator

可以在GOPATH看看有没有github.com/gogo/protobuf/gogoproto目录不呢

@liming127
Copy link
Author

image

@liming127
Copy link
Author

➜ grpc git:(master) ✗ ls $GOPATH/src/github.com/gogo/protobuf/gogoproto
Makefile doc.go gogo.pb.go gogo.pb.golden gogo.proto helper.go
➜ grpc git:(master) ✗ ls $GOPATH/src/google/protobuf/
any.proto compiler duration.proto field_mask.proto struct.proto type.proto
api.proto descriptor.proto empty.proto source_context.proto timestamp.proto wrappers.proto
➜ grpc git:(master) ✗ protoc api.proto --go_out=./ --proto_path=../../comet/grpc:$GOPATH/src/github.com/gogo/protobuf/gogoproto/:$GOPATH/src/google/protobuf/
github.com/gogo/protobuf/gogoproto/gogo.proto: File not found.
api.proto:6:1: Import "github.com/gogo/protobuf/gogoproto/gogo.proto" was not found or had errors.
➜ grpc git:(master) ✗ ß

@tonybase
Copy link
Collaborator

tonybase commented May 1, 2020

可以把gogoproto clone到$GOPATH/src/github.com/gogo/protobuf/gogoproto/,或者直接使用kratos tool protoc api.proto

@jiayiming001
Copy link

我是在 goim/api/logic/grpc 目录下, 保证GOPATH 下有gogo/protobuf
protoc -I=../../comet/grpc -I=${GOPATH}/src --go_out=plugins=grpc:. api.proto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants