slices

package
v2.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clip added in v2.3.0

func Clip[S ~[]E, E any](s S) S

Clip removes unused capacity from the slice, returning s[:len(s):len(s)].

func Clone

func Clone[S ~[]E, E any](s S) S

func CompareFunc

func CompareFunc[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, cmp func(E1, E2) int) int

func Contains

func Contains[S ~[]E, E comparable](s S, v E) bool

func ContainsFunc

func ContainsFunc[S ~[]E, E any](s S, f func(E) bool) bool

func Delete

func Delete[S ~[]E, E any](s S, i, j int) S

func DeleteFunc

func DeleteFunc[S ~[]E, E any](s S, del func(E) bool) S

func Equal added in v2.3.0

func Equal[S ~[]E, E comparable](s1, s2 S) bool

func Index

func Index[S ~[]E, E comparable](s S, v E) int

func IndexFunc

func IndexFunc[S ~[]E, E any](s S, f func(E) bool) int

func IsSortedFunc

func IsSortedFunc[S ~[]E, E any](x S, cmp func(a, b E) int) bool

func Max added in v2.3.0

func Max[S ~[]E, E Ordered](x S) E

func SortFunc

func SortFunc[S ~[]E, E any](x S, cmp func(a, b E) int)

Types

type Ordered added in v2.3.0

type Ordered = cmp.Ordered

Jump to

Keyboard shortcuts

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