Back to

Package hreflect

Latest Go to latest

The latest major version is .

Published: Jul 23, 2020 | License: Apache-2.0 | Module:


Package hreflect contains reflect helpers.


func IsTruthful

func IsTruthful(in interface{}) bool

IsTruthful returns whether in represents a truthful value. See IsTruthfulValue

func IsTruthfulValue

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:

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier