hugo: Index | Files

package hreflect

import ""

Package hreflect contains reflect helpers.


Package Files


func IsFloat Uses

func IsFloat(kind reflect.Kind) bool

IsFloat returns whether the given kind is a float.

func IsInt Uses

func IsInt(kind reflect.Kind) bool

IsInt returns whether the given kind is an int.

func IsNumber Uses

func IsNumber(kind reflect.Kind) bool

TODO(bep) replace the private versions in /tpl with these. IsInt returns whether the given kind is a number.

func IsTruthful Uses

func IsTruthful(in interface{}) bool

IsTruthful returns whether in represents a truthful value. See IsTruthfulValue

func IsTruthfulValue Uses

func IsTruthfulValue(val reflect.Value) (truth bool)

IsTruthfulValue returns whether the given value has a meaningful truth value. This is based on template.IsTrue in Go's stdlib, but also considers IsZero and any interface value will be unwrapped before it's considered for truthfulness.

Based on:

func IsUint Uses

func IsUint(kind reflect.Kind) bool

IsUint returns whether the given kind is an uint.

Package hreflect imports 2 packages (graph) and is imported by 26 packages. Updated 2020-12-12. Refresh now. Tools for package owners.