sliceutil

package
v0.0.0-...-65dd48a Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dedup

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

Types

type SortFunc

type SortFunc[T any] func(v1, v2 T) int

type Sorter

type Sorter[T any] struct {
	// contains filtered or unexported fields
}

func Ordered

func Ordered[T any]() *Sorter[T]

func (*Sorter[T]) By

func (s *Sorter[T]) By(compf ...SortFunc[T]) *Sorter[T]

func (*Sorter[T]) Len

func (s *Sorter[T]) Len() int

func (*Sorter[T]) Less

func (s *Sorter[T]) Less(i, j int) bool

func (*Sorter[T]) Sort

func (s *Sorter[T]) Sort(items []T)

func (*Sorter[T]) Swap

func (s *Sorter[T]) Swap(i, j int)

Jump to

Keyboard shortcuts

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