Skip to content

Commit a8c477f

Browse files
doanbutarshantanualsi
authored andcommitted
docs: Update template_functions.md (#12841)
1 parent 90f995d commit a8c477f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/sources/query/template_functions.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -303,26 +303,26 @@ Example:
303303

304304
Use this function to test to see if one string is contained inside of another.
305305

306-
Signature: `contains(s string, src string) bool`
306+
Signature: `contains(src string, s string,) bool`
307307

308308
Examples:
309309

310310
```template
311-
{{ if contains .err "ErrTimeout" }} timeout {{end}}
311+
{{ if contains "ErrTimeout" .err }} timeout {{end}}
312312
{{ if contains "he" "hello" }} yes {{end}}
313313
```
314314

315315
## eq
316316

317317
Use this function to test to see if one string has exact matching inside of another.
318318

319-
Signature: `eq(s string, src string) bool`
319+
Signature: `eq(src string, s string) bool`
320320

321321
Examples:
322322

323323
```template
324-
{{ if eq .err "ErrTimeout" }} timeout {{end}}
325-
{{ if eq "he" "hello" }} yes {{end}}
324+
{{ if eq "ErrTimeout" .err}} timeout {{end}}
325+
{{ if eq "hello" "hello" }} yes {{end}}
326326
```
327327

328328
## hasPrefix and hasSuffix

0 commit comments

Comments
 (0)