Skip to content

Commit

Permalink
cmd/protoc-gen-go-grpc: don't emit const blocks for services with no …
Browse files Browse the repository at this point in the history
…methods (#7055)
  • Loading branch information
conorevans authored Mar 21, 2024
1 parent eb5828b commit a975978
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/protoc-gen-go-grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func (serviceGenerateHelper) formatFullMethodSymbol(service *protogen.Service, m
}

func (serviceGenerateHelper) genFullMethods(g *protogen.GeneratedFile, service *protogen.Service) {
if len(service.Methods) == 0 {
return
}

g.P("const (")
for _, method := range service.Methods {
fmSymbol := helper.formatFullMethodSymbol(service, method)
Expand Down

0 comments on commit a975978

Please sign in to comment.