hugo: Index | Files

package cast

import ""

Package cast provides template functions for data type conversions.


Package Files

cast.go docshelper.go init.go

type Namespace Uses

type Namespace struct {

Namespace provides template functions for the "cast" namespace.

func New Uses

func New() *Namespace

New returns a new instance of the cast-namespaced template functions.

func (*Namespace) ToFloat Uses

func (ns *Namespace) ToFloat(v interface{}) (float64, error)

ToFloat converts the given value to a float.

func (*Namespace) ToInt Uses

func (ns *Namespace) ToInt(v interface{}) (int, error)

ToInt converts the given value to an int.

func (*Namespace) ToString Uses

func (ns *Namespace) ToString(v interface{}) (string, error)

ToString converts the given value to a string.

Package cast imports 8 packages (graph) and is imported by 44 packages. Updated 2020-03-21. Refresh now. Tools for package owners.