mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-16 09:34:52 -04:00
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
This commit is contained in:
parent
c5925250d5
commit
12f46f356e
25
content/en/functions/reflect.IsMap.md
Normal file
25
content/en/functions/reflect.IsMap.md
Normal file
@ -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
|
||||||
|
```
|
25
content/en/functions/reflect.IsSlice.md
Normal file
25
content/en/functions/reflect.IsSlice.md
Normal file
@ -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
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user