gitlab.com/evatix-go/core@v1.3.55/regexnew/CreateMustLockIf.go (about)

     1  package regexnew
     2  
     3  import "regexp"
     4  
     5  func CreateMustLockIf(
     6  	isLock bool,
     7  	regularExpressionSyntax string,
     8  ) *regexp.Regexp {
     9  	if isLock {
    10  		regexMutex.Lock()
    11  
    12  		defer regexMutex.Unlock()
    13  	}
    14  
    15  	return CreateMust(regularExpressionSyntax)
    16  }