-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Unwanted files generated when have external import and set all=true
#100
Comments
Instead of |
Hi, but i get this: $ tree
.
├── google
│ └── protobuf
│ └── timestamp.proto.xx.go
├── timesvc.pb.go
├── timesvc.proto
├── timesvc.proto.xx.go
└── {{.File.Name}}.xx.go.tmpl A "google/protobuf/timestamp.proto.xx.go" is generated |
I think the problem is here in the loop in // Generate the encoders
log.Printf(">> files to genrate: %#v\n", g.Request.FileToGenerate)
for _, file := range g.Request.GetProtoFile() {
log.Printf(">> files and their depencies: %+q %+q\n", *file.Name, *file.Package)
if all {
if singlePackageMode {
... Rerun the above commands will get: protoc --go_out=. --gotemplate_out=all=true,template_dir=.:. *.proto
2018/08/02 10:21:09 >> files to genrate: []string{"timesvc.proto"}
2018/08/02 10:21:09 >> files and their depencies: "google/protobuf/timestamp.proto" "google.protobuf"
2018/08/02 10:21:09 >> files and their depencies: "timesvc.proto" "timesvc" The loop should ignore files that's not in
|
Hi, can anybody look into this ? Thx |
Here's an example .proto with "timestamp.proto" imported:
And template looks like:
After running
$ protoc --go_out=. --gotemplate_out=all=true,template_dir=.:. *.proto $ ls {{.File.Package}}.xx.go.tmpl google.protobuf.xx.go timesvc.pb.go timesvc.proto timesvc.xx.go
A 'google.protobuf.xx.go' is generated as well. And i don't know how to avoid generating it.
The text was updated successfully, but these errors were encountered: