slices

package
v0.0.0-...-0235693 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone[T any](ts []T) []T

func Contains

func Contains[T comparable](ts []T, t T) bool

func ContainsFunc

func ContainsFunc[T any](ts []T, match func(mt T) bool) bool

func Dedup

func Dedup[T comparable](ts []T) []T

func DedupFunc

func DedupFunc[T any](ts []T, eq func(t1, t2 T) bool) []T

func DeleteFirst

func DeleteFirst[T comparable](ts []T, t T) []T

func DeleteIdx

func DeleteIdx[T comparable](ts []T, i int) []T

func Equal

func Equal[T comparable](ts1 []T, ts2 []T) bool

func Find

func Find[T comparable](ts []T, t T) int

func FindFunc

func FindFunc[T any](ts []T, match func(mt T) bool) int

func Insert

func Insert[T any](ts []T, t T, atIdx int) []T

func Repeat

func Repeat[T any](t T, count int) []T

func Reverse

func Reverse[T any](ts []T) []T

func Sort

func Sort[T constraints.Ordered](ts []T)

func Sum

func Sum[T Number](ts []T) T

Types

type Number

type Number interface {
	constraints.Integer | constraints.Float
}

Jump to

Keyboard shortcuts

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