refactored
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
// WildcardMXIDsToRegexes converts a list of wildcard patterns to a list of regular expressions
|
||||
func WildcardMXIDsToRegexes(wildCardPatterns []string) (*[]*regexp.Regexp, error) {
|
||||
func WildcardMXIDsToRegexes(wildCardPatterns []string) ([]*regexp.Regexp, error) {
|
||||
regexPatterns := make([]*regexp.Regexp, len(wildCardPatterns))
|
||||
|
||||
for idx, wildCardPattern := range wildCardPatterns {
|
||||
@@ -18,7 +18,7 @@ func WildcardMXIDsToRegexes(wildCardPatterns []string) (*[]*regexp.Regexp, error
|
||||
regexPatterns[idx] = regex
|
||||
}
|
||||
|
||||
return ®exPatterns, nil
|
||||
return regexPatterns, nil
|
||||
}
|
||||
|
||||
// Match tells if the given user id is allowed to use the bot, according to the given whitelist
|
||||
|
||||
Reference in New Issue
Block a user