diff --git a/cmd/protoc-gen-connect-go/main.go b/cmd/protoc-gen-connect-go/main.go index 205ec9f4..f113edca 100644 --- a/cmd/protoc-gen-connect-go/main.go +++ b/cmd/protoc-gen-connect-go/main.go @@ -425,7 +425,7 @@ func generateServerConstructor(g *protogen.GeneratedFile, service *protogen.Serv } g.P(")") } - g.P(`return "/`, reflectionName(service), `/", `, httpPackage.Ident("HandlerFunc"), `(func(w `, httpPackage.Ident("ResponseWriter"), `, r *`, httpPackage.Ident("Request"), `){`) + g.P(`return "/`, string(service.Desc.FullName()), `/", `, httpPackage.Ident("HandlerFunc"), `(func(w `, httpPackage.Ident("ResponseWriter"), `, r *`, httpPackage.Ident("Request"), `){`) g.P("switch r.URL.Path {") for _, method := range service.Methods { g.P("case ", procedureConstName(method), ":") @@ -510,10 +510,6 @@ func procedureHandlerName(m *protogen.Method) string { return fmt.Sprintf("%s%sHandler", unexport(m.Parent.GoName), m.GoName) } -func reflectionName(service *protogen.Service) string { - return string(service.Desc.FullName()) -} - func isDeprecatedService(service *protogen.Service) bool { serviceOptions, ok := service.Desc.Options().(*descriptorpb.ServiceOptions) return ok && serviceOptions.GetDeprecated()