slice

package
v1.0.1006 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T Ordered](items []T, item T) bool

判断是否在数组里

func Max

func Max[T IntegerFloat](items ...T) T

取最大值

func Merge

func Merge[T any](items ...[]T) (c []T)

合并

func Min

func Min[T IntegerFloat](items ...T) T

取最小值

func Sum

func Sum[T MathInteger](s ...T) (sum T)

求和

func Unique

func Unique[T Ordered](s []T) []T

排除相同数据

Types

type Complex

type Complex interface {
	~complex64 | ~complex128
}

type Float

type Float interface {
	~float32 | ~float64
}

type Integer

type Integer interface {
	Signed | Unsigned
}

type IntegerFloat

type IntegerFloat interface {
	Integer | Float
}

type MathInteger

type MathInteger interface {
	Integer | Float | Complex
}

type Ordered

type Ordered interface {
	Integer | Float | ~string
}

type Signed

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
}

Jump to

Keyboard shortcuts

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