summaryrefslogtreecommitdiffstats
path: root/docs/content
diff options
context:
space:
mode:
authorCameron Moore <moorereason@gmail.com>2018-12-07 16:29:37 -0600
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-12-07 23:29:37 +0100
commitc84f506f8ef1f2ca94ab96718a22ba6e290235ac (patch)
tree9233ea0fa7141a811225f19f735ad0c6d52e95ee /docs/content
parent4b5f743959394d443c4dcaa0ccae21842b51adaf (diff)
tpl: Add reflect namespace
Add a reflect namespace that offers a two boolean functions for testing if a value is a map or slice. Fixes #4081
Diffstat (limited to 'docs/content')
-rw-r--r--docs/content/en/functions/reflect.IsMap.md25
-rw-r--r--docs/content/en/functions/reflect.IsSlice.md25
2 files changed, 50 insertions, 0 deletions
diff --git a/docs/content/en/functions/reflect.IsMap.md b/docs/content/en/functions/reflect.IsMap.md
new file mode 100644
index 000000000..d75b842b4
--- /dev/null
+++ b/docs/content/en/functions/reflect.IsMap.md
@@ -0,0 +1,25 @@
+---
+title: reflect.IsMap
+description: Reports if a value is a map.
+godocref:
+date: 2018-11-28
+publishdate: 2018-11-28
+lastmod: 2018-11-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [reflect, reflection, kind]
+signature: ["reflect.IsMap INPUT"]
+workson: []
+hugoversion: "v0.53"
+relatedfuncs: [reflect.IsSlice]
+deprecated: false
+---
+
+`reflect.IsMap` reports if `VALUE` is a map. Returns a boolean.
+
+```
+{{ reflect.IsMap (dict "key" "value") }} → true
+{{ reflect.IsMap "yo" }} → false
+```
diff --git a/docs/content/en/functions/reflect.IsSlice.md b/docs/content/en/functions/reflect.IsSlice.md
new file mode 100644
index 000000000..27d6aea21
--- /dev/null
+++ b/docs/content/en/functions/reflect.IsSlice.md
@@ -0,0 +1,25 @@
+---
+title: reflect.IsSlice
+description: Reports if a value is a slice.
+godocref:
+date: 2018-11-28
+publishdate: 2018-11-28
+lastmod: 2018-11-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [reflect, reflection, kind]
+signature: ["reflect.IsSlice INPUT"]
+workson: []
+hugoversion: "0.53"
+relatedfuncs: [reflect.IsMap]
+deprecated: false
+---
+
+`reflect.IsSlice` reports if `VALUE` is a slice. Returns a boolean.
+
+```
+{{ reflect.IsSlice (slice 1 2 3) }} → true
+{{ reflect.IsSlice "yo" }} → false
+```