Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-01-13 11:07:05 +03:00
parent 3e83d1c50a
commit 4993c2ec68

View File

@ -205,8 +205,17 @@ func main() {
} }
} }
filesToGenerate := map[string]struct{}{}
for _, file := range g.Request.FileToGenerate {
filesToGenerate[file] = struct{}{}
}
// Generate the encoders // Generate the encoders
for _, file := range g.Request.GetProtoFile() { for _, file := range g.Request.GetProtoFile() {
// Ignore files not in g.Request.FileToGenerate.
if _, ok := filesToGenerate[*file.Name]; !ok {
continue
}
if all { if all {
if singlePackageMode { if singlePackageMode {
if _, err = registry.LookupFile(file.GetName()); err != nil { if _, err = registry.LookupFile(file.GetName()); err != nil {