From b3828b175d8b5c4276db2956cd3f737b94fb8059 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Thu, 7 May 2020 18:04:37 -0400 Subject: [PATCH] include the operator in the 'unexpected operator' error message --- pkg/analyze/text_analyze.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/analyze/text_analyze.go b/pkg/analyze/text_analyze.go index fbd17c7a..0dd7c013 100644 --- a/pkg/analyze/text_analyze.go +++ b/pkg/analyze/text_analyze.go @@ -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