logic

package
v3.0.0-rc Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Or

func Or[T comparable](a, b T) T

Or acts like "||" for values in any other language. Unfortunately, in Go this operator only works for conditions. Please note, this operator is just a function and not prevents execution.

Usage:

zen.Or(0, 1) // 1

func Tr

func Tr[T comparable](condition bool, v1, v2 T) T

Tr acts like a ternary operator in other languages. Unfortunately, Go doesn't have this operator. Please note, this operator is just a function and not prevents execution.

Usage:

zen.Tr(false, "asd", "qwe") // string{"qwe"}

Types

This section is empty.

Jump to

Keyboard shortcuts

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