utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TernaryIf

func TernaryIf[T any](cond bool, vtrue, vfalse T) T

TernaryIf, implements the missing ternary operator in go in the form

cond ? vtrue : vfalse

func TernaryIfIf

func TernaryIfIf[T any](condA bool, atrue T, condB bool, vtrue, vfalse T) T

TernaryIfIf, implements a double layer ternary operator of the form:

condA ? atrue : (condB? vtrue : vfalse)

Types

This section is empty.

Jump to

Keyboard shortcuts

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