Skip to content

Commit

Permalink
tpl: Add method mappings for strings.Contains, strings.ContainsAny
Browse files Browse the repository at this point in the history
Just to confirm/document the function signature.
  • Loading branch information
bep committed Feb 23, 2021
1 parent 01dd7c1 commit 7f85300
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tpl/strings/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 7f85300

Please # to comment.