operation

package
v1.35.20 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDifference

func GetDifference[T comparable](setA, setB []T) (difference []T)

GetDifference 获取两个数组的差集

func GetIntersection

func GetIntersection[T comparable](setA, setB []T) (intersection []T)

GetIntersection 获取两个数组的交集

func GetUnion

func GetUnion[T comparable](setA, setB []T) (union []T)

GetUnion 获取两个数组的并集

func Max

func Max[T constraints.Ordered](values ...T) (T, error)

Max 获取最大值

func Min

func Min[T constraints.Ordered](values ...T) (T, error)

Min 获取最小值

func Ternary

func Ternary[V any](condition bool, T, F V) V

Ternary 三元运算:通过值

func TernaryFunc

func TernaryFunc[V any](condition func() bool, T V, F V) V

TernaryFunc 三元运算:通过回调函数

func TernaryFuncAll

func TernaryFuncAll[V any](condition func() bool, trueFn func() V, falseFn func() V) V

TernaryFuncAll 三元运算:通过回调函数,返回值也使用回调函数

func TernaryFuncReturn

func TernaryFuncReturn[V any](condition bool, trueFn func() V, falseFn func() V) V

TernaryFuncReturn 三元运算:返回值使用回调方法

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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