In.md - hugo - [fork] hugo port for 9front
(HTM) git clone https://git.drkhsh.at/hugo.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
In.md (638B)
---
1 ---
2 title: collections.In
3 description: Reports whether the given value is a member of the given set.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 aliases: [in]
9 returnType: bool
10 signatures: [collections.In SET VALUE]
11 aliases: [/functions/in]
12 ---
13
14 The `SET` can be an [array](g), [slice](g), or [string](g).
15
16 ```go-html-template
17 {{ $s := slice "a" "b" "c" }}
18 {{ in $s "b" }} → true
19 ```
20
21 ```go-html-template
22 {{ $s := slice 1 2 3 }}
23 {{ in $s 2 }} → true
24 ```
25
26 ```go-html-template
27 {{ $s := slice 1.11 2.22 3.33 }}
28 {{ in $s 2.22 }} → true
29 ```
30
31 ```go-html-template
32 {{ $s := "abc" }}
33 {{ in $s "b" }} → true
34 ```