tpl: Add method mappings for strings.Contains, strings.ContainsAny

Just to confirm/document the function signature.
This commit is contained in:
Bjørn Erik Pedersen 2021-02-23 09:36:11 +01:00
parent 01dd7c16af
commit 7f8530039a
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -58,6 +58,22 @@ func init() {
},
)
ns.AddMethodMapping(ctx.Contains,
nil,
[][2]string{
{`{{ strings.Contains "abc" "b" }}`, `true`},
{`{{ strings.Contains "abc" "d" }}`, `false`},
},
)
ns.AddMethodMapping(ctx.ContainsAny,
nil,
[][2]string{
{`{{ strings.ContainsAny "abc" "bcd" }}`, `true`},
{`{{ strings.ContainsAny "abc" "def" }}`, `false`},
},
)
ns.AddMethodMapping(ctx.FindRE,
[]string{"findRE"},
[][2]string{