Skip to content

Commit

Permalink
cmd/protoc-gen-go-grpc: replace usages of deprecated API (#7071)
Browse files Browse the repository at this point in the history
  • Loading branch information
schroederc authored Apr 1, 2024
1 parent feb968b commit 4ec8307
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/protoc-gen-go-grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ func genService(gen *protogen.Plugin, file *protogen.File, g *protogen.Generated
g.P("//")
g.P(deprecationComment)
}
g.Annotate(clientName, service.Location)
g.AnnotateSymbol(clientName, protogen.Annotation{Location: service.Location})
g.P("type ", clientName, " interface {")
for _, method := range service.Methods {
g.Annotate(clientName+"."+method.GoName, method.Location)
g.AnnotateSymbol(clientName+"."+method.GoName, protogen.Annotation{Location: method.Location})
if method.Desc.Options().(*descriptorpb.MethodOptions).GetDeprecated() {
g.P(deprecationComment)
}
Expand Down Expand Up @@ -250,10 +250,10 @@ func genService(gen *protogen.Plugin, file *protogen.File, g *protogen.Generated
g.P("//")
g.P(deprecationComment)
}
g.Annotate(serverType, service.Location)
g.AnnotateSymbol(serverType, protogen.Annotation{Location: service.Location})
g.P("type ", serverType, " interface {")
for _, method := range service.Methods {
g.Annotate(serverType+"."+method.GoName, method.Location)
g.AnnotateSymbol(serverType+"."+method.GoName, protogen.Annotation{Location: method.Location})
if method.Desc.Options().(*descriptorpb.MethodOptions).GetDeprecated() {
g.P(deprecationComment)
}
Expand Down

0 comments on commit 4ec8307

Please sign in to comment.