IsValidRepositoryURL checks if the given URL is valid for the specified repository source
(source RepositorySource, url string)
| 16 | |
| 17 | // IsValidRepositoryURL checks if the given URL is valid for the specified repository source |
| 18 | func IsValidRepositoryURL(source RepositorySource, url string) bool { |
| 19 | switch source { |
| 20 | case SourceGitHub: |
| 21 | return githubURLRegex.MatchString(url) |
| 22 | case SourceGitLab: |
| 23 | return gitlabURLRegex.MatchString(url) |
| 24 | } |
| 25 | return false |
| 26 | } |
| 27 | |
| 28 | // HasNoSpaces checks if a string contains no spaces |
| 29 | func HasNoSpaces(s string) bool { |
no outgoing calls
no test coverage detected
searching dependent graphs…