HUGO
Menu
GitHub 90556 stars Mastodon

reflect.IsSlice

Reports whether the given value is a slice.
Syntax
reflect.IsSlice INPUT
Returns
bool

Usage

The reflect.IsSlice function reports whether the given value is a slice. The function also returns true for a page collection, such as the value returned by the RegularPages method on a Site object.

Examples

{{ reflect.IsSlice (slice 1 2 3) }} → true
{{ reflect.IsSlice (dict "key" "value") }} → false
{{ reflect.IsSlice "yo" }} → false

Checking values returned by other functions and methods:

{{ reflect.IsSlice (split "a,b,c" ",") }} → true
{{ reflect.IsSlice site.RegularPages }} → true