MCPcopy Create free account
hub / github.com/JordanCoin/codemap / extractRepoName

Function extractRepoName

main.go:862–874  ·  view source on GitHub ↗

extractRepoName extracts "owner/repo" from a GitHub URL

(url string)

Source from the content-addressed store, hash-verified

860
861// extractRepoName extracts "owner/repo" from a GitHub URL
862func extractRepoName(url string) string {
863 // Remove protocol
864 url = strings.TrimPrefix(url, "https://")
865 url = strings.TrimPrefix(url, "http://")
866 // Remove host
867 url = strings.TrimPrefix(url, "github.com/")
868 url = strings.TrimPrefix(url, "gitlab.com/")
869 // Remove trailing .git
870 url = strings.TrimSuffix(url, ".git")
871 // Remove trailing slashes
872 url = strings.TrimSuffix(url, "/")
873 return url
874}

Callers 3

resolveBlastRadiusRootFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1