typeutil

package
v2.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package typeutil adds functions for types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default[T comparable](val, def T) T

Default returns `val` if it is not zero, otherwise returns `def`.

v := Default("", "hello") // return "hello" v := Default("world", "hello") // return "world"

Types

This section is empty.

Jump to

Keyboard shortcuts

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