Support `hasPrefix` and `hasSuffix` string verifier (#83)
diff --git a/CHANGES.md b/CHANGES.md
index 513c644..357f4f0 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -6,6 +6,7 @@
------------------
#### Features
* Support `sha256enc` and `sha512enc` encoding in verify case.
+* Support `hasPrefix` and `hasSuffix` string verifier in verify case.
#### Bug Fixes
diff --git a/docs/en/setup/Configuration-File.md b/docs/en/setup/Configuration-File.md
index 0c05613..d10a93f 100644
--- a/docs/en/setup/Configuration-File.md
+++ b/docs/en/setup/Configuration-File.md
@@ -209,6 +209,8 @@
|le|Verify the first param is less than or equals second param |{{le param1 param2}}|param1|<wanted gt $param2, but was $param1>|
|regexp|Verify the first param matches the second regular expression|{{regexp param1 param2}}|param1|<"$param1" does not match the pattern $param2">|
|notEmpty|Verify The param is not empty|{{notEmpty param}}|param|<"" is empty, wanted is not empty>|
+|hasPrefix|Verify The string param has the same prefix.|{{hasPrefix param1 param2}}|true|false|
+|hasSuffix|Verify The string param has the same suffix.|{{hasSuffix param1 param2}}|true|false|
##### List Matches
diff --git a/third-party/go/template/funcs.go b/third-party/go/template/funcs.go
index 49c1ee7..f01dedf 100644
--- a/third-party/go/template/funcs.go
+++ b/third-party/go/template/funcs.go
@@ -58,6 +58,10 @@
"le": le, // <=
"lt": lt, // <
"ne": ne, // !=
+
+ // string comparisons
+ "hasPrefix": strings.HasPrefix,
+ "hasSuffix": strings.HasSuffix,
}
}