Simplify MatchUserWithAllowedRegexes

This used to return an error back when it was dealing with wildcards
(which may or may not have compiled to a valid regex).

But it now deals with pre-compiled regexes and has no chance of failing,
so we need no `error` returns.
This commit is contained in:
Slavi Pantaleev
2022-08-26 10:19:33 +03:00
parent f8a168b8e7
commit bb754f9aa8
2 changed files with 5 additions and 8 deletions

View File

@@ -202,10 +202,7 @@ func TestMatch(t *testing.T) {
t.Error(err)
}
actualResult, err := MatchUserWithAllowedRegexes(testData.checkedValue, *allowedUserRegexes)
if err != nil {
t.Error(err)
}
actualResult := MatchUserWithAllowedRegexes(testData.checkedValue, *allowedUserRegexes)
if actualResult == testData.expectedResult {
return