include the operator in the 'unexpected operator' error message

This commit is contained in:
Andrew Lavery
2020-05-07 18:04:37 -04:00
parent f377b7c1a8
commit b3828b175d

View File

@@ -1,6 +1,7 @@
package analyzer
import (
"fmt"
"path/filepath"
"regexp"
"strconv"
@@ -215,7 +216,7 @@ func compareRegex(conditional string, foundMatches map[string]string) (bool, err
} else {
// all we can support is "=" and "==" and "===" for now
if operator != "=" && operator != "==" && operator != "===" {
return false, errors.New("unexpected operator in regex comparator")
return false, fmt.Errorf("unexpected operator %q in regex comparator", operator)
}
return foundValue == lookForValue, nil