MCPcopy Create free account
hub / github.com/github/gh-aw / normalizeHostForHint

Function normalizeHostForHint

pkg/cli/fetch.go:242–249  ·  view source on GitHub ↗
(host string)

Source from the content-addressed store, hash-verified

240}
241
242func normalizeHostForHint(host string) string {
243 host = strings.TrimSpace(strings.ToLower(host))
244 host = strings.TrimPrefix(strings.TrimPrefix(host, "https://"), "http://")
245 if idx := strings.Index(host, "/"); idx >= 0 {
246 host = host[:idx]
247 }
248 return strings.TrimSuffix(host, "/")
249}
250
251// sleepForSHAResolutionRetry waits for the retry delay or context cancellation.
252// It returns ctx.Err() when the context is cancelled before the delay elapses,

Callers 1

Calls 1

ToLowerMethod · 0.80

Tested by

no test coverage detected