getRepoNamespaceFromUrlPath returns the namespace of a repository from the given URL path, which is the url path without the last segment, and without leading and trailing slashes.
(path string)
| 361 | // returns the namespace of a repository from the given URL path, |
| 362 | // which is the url path without the last segment, and without leading and trailing slashes. |
| 363 | func getRepoNamespaceFromUrlPath(path string) string { |
| 364 | // Remove leading and trailing slashes |
| 365 | path = strings.Trim(path, "/") |
| 366 | // Remove last segment |
| 367 | path = path[:strings.LastIndex(path, "/")] |
| 368 | return path |
| 369 | } |
| 370 | |
| 371 | // getRepoNameFromUrlPath |
| 372 | // returns the last segment of url path as repo name, without .git suffix. |
no outgoing calls
no test coverage detected