tools

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortUniqItems

func SortUniqItems[T constraints.Ordered](items []T) []T

func Tern

func Tern[T any](cond bool, v1, v2 T) T

Types

type Set

type Set[T constraints.Ordered] map[T]bool

Set - set of items

func NewSet

func NewSet[T constraints.Ordered](values ...T) Set[T]

func (Set[T]) Add

func (ss Set[T]) Add(values ...T) Set[T]

func (Set[T]) AddComplement

func (ss Set[T]) AddComplement(values ...T) []T

func (Set[T]) Complement

func (ss Set[T]) Complement(values ...T) []T

func (Set[T]) Del

func (ss Set[T]) Del(values ...T) Set[T]

func (Set[T]) Empty

func (ss Set[T]) Empty() bool

func (Set[T]) Includes

func (ss Set[T]) Includes(v T) bool

func (Set[T]) Len

func (ss Set[T]) Len() int

func (Set[T]) List

func (ss Set[T]) List() []T

func (Set[T]) Sorted

func (ss Set[T]) Sorted() []T

func (Set[T]) String

func (ss Set[T]) String() string

Jump to

Keyboard shortcuts

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