hugo: Index | Files

package hreflect

import ""

Package hreflect contains reflect helpers.


Package Files


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:

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