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

Support batch generation with import #790

Closed
alx696 opened this issue Jan 18, 2019 · 3 comments
Closed

Support batch generation with import #790

alx696 opened this issue Jan 18, 2019 · 3 comments

Comments

@alx696
Copy link

alx696 commented Jan 18, 2019

Is your feature request related to a problem? Please describe.
son.proto import father.proto from different go_package but same dir. Cant execute protoc:

x@x-ThinkPad-T460:~/go/src/lilu.red/proto$ protoc --go_out=plugins=grpc:$GOPATH/src *.proto
2019/01/18 15:32:06 protoc-gen-go: error:inconsistent package import paths: "lilu.red/proto/father", "lilu.red/proto/son"
--go_out: protoc-gen-go: Plugin failed with status code 1.

Must protoc one by one manual:

x@x-ThinkPad-T460:~/go/src/lilu.red/proto$ protoc --go_out=plugins=grpc:$GOPATH/src father.proto
x@x-ThinkPad-T460:~/go/src/lilu.red/proto$ protoc --go_out=plugins=grpc:$GOPATH/src son.proto

If lots of proto, not good any more. I can protoc son.proto first, no error alert. Imply no required check, why alert error:inconsistent package import paths?

Describe the solution you'd like
Batch generation with one protoc:

$ protoc --go_out=plugins=grpc:$GOPATH/src *.proto

Describe alternatives you've considered
Automatically generated one by one.

Additional context
father.proto

syntax = "proto3";

package auto.grpc.father;
option go_package = "lilu.red/proto/father";

message Info {
  string name = 1;
}

son.proto

syntax = "proto3";

package auto.grpc.son;
option go_package = "lilu.red/proto/son";

import "father.proto";

service SonService {
  rpc Insert (Info) returns (Info) {
  }
}

message Info {
  string id = 1; //auto set
  string name = 2;
  father.Info father = 3;
}
@alx696 alx696 changed the title Support batch generation Support batch generation with import Jan 18, 2019
@lpflpf
Copy link

lpflpf commented Mar 11, 2019

I had the same question, have you solved it?

@alx696
Copy link
Author

alx696 commented Mar 11, 2019

@lpflpf No...

@dsnet
Copy link
Member

dsnet commented Jul 10, 2019

Duplicate of #39

@dsnet dsnet marked this as a duplicate of #39 Jul 10, 2019
@dsnet dsnet closed this as completed Jul 10, 2019
@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants