Skip to content

Commit

Permalink
Drop helper reflectionName
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane committed Oct 3, 2023
1 parent 6bcc074 commit d0deac1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cmd/protoc-gen-connect-go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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), ":")
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit d0deac1

Please sign in to comment.