Skip to content

Commit

Permalink
Skip generated files with no kvstore messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsundar committed Dec 29, 2023
1 parent c87d556 commit fbd55cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/protoc-gen-go-kvstore/internal/generators/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func GenerateFile(gen *protogen.Plugin, file *protogen.File) {
Pairs: extractKeyValuePairs(file),
}

if len(templateCtx.Pairs) == 0 {
return
}

value, err := Render(templateCtx)
if err != nil {
fmt.Printf("%s\n", err)
Expand Down

0 comments on commit fbd55cd

Please sign in to comment.