cmp

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Excludes

func Excludes[T comparable](src []T, ts ...T) []T

Excludes returns the elements in src that are not in ts.

func Has

func Has[T comparable](s []T, e T) bool

Has checks whether a value is in a slice.

func Includes

func Includes[T comparable](src []T, ts ...T) []T

Includes returns the elements in src that are in ts.

func IsZero

func IsZero[T comparable](v T) bool

IsZero returns true if the value is zero.

func Or

func Or[T comparable](vals ...T) T

Or returns the first non-zero value.

func ZeroOr

func ZeroOr[T comparable](v T, def T) T

ZeroOr returns def if v is the zero value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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