diff --git a/cmd/protoc-gen-go-grpc/grpc.go b/cmd/protoc-gen-go-grpc/grpc.go index 9e15d2d8daf3..42cff33168da 100644 --- a/cmd/protoc-gen-go-grpc/grpc.go +++ b/cmd/protoc-gen-go-grpc/grpc.go @@ -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)