xmap

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasKeys

func HasKeys[K comparable, V any](m map[K]V, ks ...K) bool

func Keys

func Keys[K comparable, V any](m map[K]V) []K

func MapByFunc

func MapByFunc[T any, K comparable, V any](s []T, fun func(item T) (K, V)) map[K]V

func Values

func Values[K comparable, V any](m map[K]V) []V

Types

type Set

type Set[T comparable] interface {
	Add(...T) Set[T]
	Remove(values ...T) Set[T]
	Contains(values ...T) bool
	Diff(set hashSet[T]) Set[T]
	Slice() []T
	String() string
	Length() int
}

func NewHashSet

func NewHashSet[T comparable](values ...T) Set[T]

Jump to

Keyboard shortcuts

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