mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Fix error string should not be capitalized (#2608)
From [Golang coding convention](https://github.com/golang/go/wiki/CodeReviewComments#error-strings) Co-Authored-By: Nguyen Van Trung [trungnvfet@outlook.com](mailto:trungnvfet@outlook.com) Signed-off-by: Nguyen Quang Huy [huynq0911@gmail.com](mailto:huynq0911@gmail.com)
This commit is contained in:
committed by
Chris O'Haver
parent
c8dbfbdcd8
commit
42cf6606fc
@@ -300,10 +300,10 @@ func getSubExprUsage(s string) int {
|
||||
func isValidRegexPattern(rewriteFrom, rewriteTo string) (*regexp.Regexp, error) {
|
||||
rewriteFromPattern, err := regexp.Compile(rewriteFrom)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Invalid regex matching pattern: %s", rewriteFrom)
|
||||
return nil, fmt.Errorf("invalid regex matching pattern: %s", rewriteFrom)
|
||||
}
|
||||
if getSubExprUsage(rewriteTo) > rewriteFromPattern.NumSubexp() {
|
||||
return nil, fmt.Errorf("The rewrite regex pattern (%s) uses more subexpressions than its corresponding matching regex pattern (%s)", rewriteTo, rewriteFrom)
|
||||
return nil, fmt.Errorf("the rewrite regex pattern (%s) uses more subexpressions than its corresponding matching regex pattern (%s)", rewriteTo, rewriteFrom)
|
||||
}
|
||||
return rewriteFromPattern, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user