Created
February 8, 2018 08:33
-
-
Save sbose78/9b93f2eeb2ce7c345a160280570ba921 to your computer and use it in GitHub Desktop.
golang wit https://github.com/fabric8-services/fabric8-wit/blob/master/search/search_repository.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func RegisterAsKnownURL(name, urlRegex string) { | |
compiledRegex := regexp.MustCompile(urlRegex) | |
groupNames := compiledRegex.SubexpNames() | |
knownURLLock.Lock() | |
defer knownURLLock.Unlock() | |
knownURLs[name] = KnownURL{ | |
URLRegex: urlRegex, | |
compiledRegex: regexp.MustCompile(urlRegex), | |
groupNamesInRegex: groupNames, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment