cast

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Namespace

type Namespace struct {
	// contains filtered or unexported fields
}

Namespace defines the methods for cast to be used as template functions.

func New

func New(d *deps.Deps) *Namespace

Creates a new cast Namespace

func (*Namespace) ToSlice

func (ns *Namespace) ToSlice(i interface{}) []interface{}

ToSlice

Casts an interface to a []interface{} type.

Example: {{ toSlice 1 }} Returns: `[1]`

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL