|
|
@@ -150,7 +150,7 @@ func genService(gen *protogen.Plugin, file *protogen.File, g *protogen.Generated
|
|
|
continue
|
|
|
}
|
|
|
g.P("{")
|
|
|
- g.P("MethodName: ", strconv.Quote(method.GoName), ",")
|
|
|
+ g.P("MethodName: ", strconv.Quote(string(method.Desc.Name())), ",")
|
|
|
g.P("Handler: ", handlerNames[i], ",")
|
|
|
g.P("},")
|
|
|
}
|
|
|
@@ -161,7 +161,7 @@ func genService(gen *protogen.Plugin, file *protogen.File, g *protogen.Generated
|
|
|
continue
|
|
|
}
|
|
|
g.P("{")
|
|
|
- g.P("StreamName: ", strconv.Quote(method.GoName), ",")
|
|
|
+ g.P("StreamName: ", strconv.Quote(string(method.Desc.Name())), ",")
|
|
|
g.P("Handler: ", handlerNames[i], ",")
|
|
|
if method.Desc.IsStreamingServer() {
|
|
|
g.P("ServerStreams: true,")
|
|
|
@@ -298,7 +298,7 @@ func genServerMethod(gen *protogen.Plugin, file *protogen.File, g *protogen.Gene
|
|
|
g.P("if interceptor == nil { return srv.(", service.GoName, "Server).", method.GoName, "(ctx, in) }")
|
|
|
g.P("info := &", grpcPackage.Ident("UnaryServerInfo"), "{")
|
|
|
g.P("Server: srv,")
|
|
|
- g.P("FullMethod: ", strconv.Quote(fmt.Sprintf("/%s/%s", service.Desc.FullName(), method.Desc.Name())), ",")
|
|
|
+ g.P("FullMethod: ", strconv.Quote(fmt.Sprintf("/%s/%s", service.Desc.FullName(), method.GoName)), ",")
|
|
|
g.P("}")
|
|
|
g.P("handler := func(ctx ", contextPackage.Ident("Context"), ", req interface{}) (interface{}, error) {")
|
|
|
g.P("return srv.(", service.GoName, "Server).", method.GoName, "(ctx, req.(*", method.InputType.GoIdent, "))")
|