MCPcopy Create free account
hub / github.com/cli/cli / baseServicePath

Function baseServicePath

internal/barista/observability/telemetry.twirp.go:656–662  ·  view source on GitHub ↗

baseServicePath composes the path prefix for the service (without ). e.g.: baseServicePath("/twirp", "my.pkg", "MyService") returns => "/twirp/my.pkg.MyService/" e.g.: baseServicePath("", "", "MyService") returns => "/MyService/"

(prefix, pkg, service string)

Source from the content-addressed store, hash-verified

654//
655// returns => "/MyService/"
656func baseServicePath(prefix, pkg, service string) string {
657 fullServiceName := service
658 if pkg != "" {
659 fullServiceName = pkg + "." + service
660 }
661 return path.Join("/", prefix, fullServiceName) + "/"
662}
663
664// parseTwirpPath extracts path components form a valid Twirp route.
665// Expected format: "[<prefix>]/<package>.<Service>/<Method>"

Callers 3

PathPrefixMethod · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected