MCPcopy
hub / github.com/grpc/grpc-go / methodFamily

Function methodFamily

trace.go:37–43  ·  view source on GitHub ↗

methodFamily returns the trace family for the given method. It turns "/pkg.Service/GetFoo" into "pkg.Service".

(m string)

Source from the content-addressed store, hash-verified

35// methodFamily returns the trace family for the given method.
36// It turns "/pkg.Service/GetFoo" into "pkg.Service".
37func methodFamily(m string) string {
38 m = strings.TrimPrefix(m, "/") // remove leading slash
39 if i := strings.Index(m, "/"); i >= 0 {
40 m = m[:i] // remove everything from second slash
41 }
42 return m
43}
44
45// traceEventLog mirrors golang.org/x/net/trace.EventLog.
46//

Callers 3

handleStreamMethod · 0.85
newAttemptLockedMethod · 0.85
TestMethodFamilyMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestMethodFamilyMethod · 0.68