MCPcopy
hub / github.com/github/github-mcp-server / normalizeBasePath

Function normalizeBasePath

pkg/http/oauth/oauth.go:265–274  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

263}
264
265func normalizeBasePath(path string) string {
266 trimmed := strings.TrimSpace(path)
267 if trimmed == "" || trimmed == "/" {
268 return ""
269 }
270 if !strings.HasPrefix(trimmed, "/") {
271 trimmed = "/" + trimmed
272 }
273 return strings.TrimSuffix(trimmed, "/")
274}
275
276func joinRoute(basePath, pattern string) string {
277 if basePath == "" {

Callers 2

routesForPatternMethod · 0.85
resolveResourcePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected