slice

package
v0.3.30 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendOnce added in v0.2.1

func AppendOnce[T comparable](arr []T, item T) []T

func Concat added in v0.2.1

func Concat[T any](a ...[]T) []T

func Flip added in v0.2.1

func Flip[T any](a []T) []T

func GetOneWithCondition added in v0.2.2

func GetOneWithCondition[T any](slice []T, f func(index int, elem T) bool) T

func Has added in v0.2.1

func Has[T comparable](arr []T, item ...T) bool

func HasInterface added in v0.2.2

func HasInterface(arr interface{}, item ...interface{}) bool

func IndexOf added in v0.2.1

func IndexOf[T comparable](arr []T, id T) int

func New added in v0.2.1

func New[T any](v ...T) []T

func Nil added in v0.2.2

func Nil[T any]() T

func NumberConvert added in v0.2.4

func NumberConvert[T1, T2 Number](arr []T1) []T2

func Remove added in v0.2.1

func Remove[T comparable](arr []T, a ...T) []T

func RemoveAt added in v0.3.4

func RemoveAt[T any](arr []T, index int) []T

func RemoveDuplicate added in v0.2.2

func RemoveDuplicate[T comparable](arr []T) []T

func RemoveOne added in v0.2.1

func RemoveOne[T comparable](arr []T, id T) []T

func RemoveOneWithCondition added in v0.2.2

func RemoveOneWithCondition[T any](slice []T, f func(index int, elem T) bool) ([]T, []T)

func RemoveWithCondition added in v0.2.2

func RemoveWithCondition[T any](slice []T, f func(index int, elem T) bool) ([]T, []T)

Types

type Float added in v0.2.4

type Float interface {
	float32 | float64
}

type KVIntString

type KVIntString struct {
	K int
	V string
}

type Number added in v0.2.4

type Number interface {
	uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | int | float32 | float64
}

type Signed added in v0.2.4

type Signed interface {
	int8 | int16 | int32 | int64 | int | float32 | float64
}

Jump to

Keyboard shortcuts

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