logic

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package logic provides conditional operations for templates

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Functions

func Functions() template.FuncMap

Functions perform logical operations

func IsZero

func IsZero(val any) bool

IsZero returns true if the value given corresponds to its types zero value, points to something zero valued, or if it's a type with a length which is 0

func When

func When(value, cond any) any

When returns 'value' if 'cond' is not a zero value, otherwise it returns an empty string

func WhenEmpty

func WhenEmpty(value, cond any) any

WhenEmpty returns 'value' if 'cond' is a zero value, otherwise it returns 'cond'

Types

This section is empty.

Jump to

Keyboard shortcuts

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