Documentation ¶
Index ¶
- func AddAll[K comparable, V any](set map[K]V, value V, keys ...K)
- func Contains[K comparable, V any](set map[K]V, key K) bool
- func ContainsAll[K comparable, V any](set map[K]V, keys ...K) bool
- func ContainsAny[K comparable, V any](set map[K]V, keys ...K) bool
- func Difference[K comparable, V any](this, other map[K]V) map[K]V
- func Discard[K comparable, V any](this, other map[K]V)
- func Intersection[K comparable, V any](this, other map[K]V) map[K]V
- func Keys[K comparable, V any](src map[K]V) []K
- func NewSet[K comparable](keys ...K) map[K]bool
- func NewSetFromSlice[K comparable, V any](value V, keys ...K) map[K]V
- func RemoveAll[K comparable, V any](set map[K]V, keys ...K)
- func SortedKeys[K constraints.Ordered, V any](src map[K]V) []K
- func SortedValues[K comparable, V constraints.Ordered](src map[K]V) []V
- func SubsetOf[K comparable, V any](this, other map[K]V) bool
- func Union[K comparable, V any](this, other map[K]V) map[K]V
- func Update[K comparable, V any](this, other map[K]V)
- func Values[K comparable, V any](src map[K]V) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAll ¶
func AddAll[K comparable, V any](set map[K]V, value V, keys ...K)
AddAll adds multiple keys to this set with the same sentinel value.
func Contains ¶
func Contains[K comparable, V any](set map[K]V, key K) bool
Contains returns true if this set contains the given key.
func ContainsAll ¶
func ContainsAll[K comparable, V any](set map[K]V, keys ...K) bool
ContainsAll returns true if this set contains every given key.
func ContainsAny ¶
func ContainsAny[K comparable, V any](set map[K]V, keys ...K) bool
ContainsAny returns true if this set contains any given key.
func Difference ¶
func Difference[K comparable, V any](this, other map[K]V) map[K]V
Difference returns a new set containing all keys in this set that don't exist in the other set.
func Discard ¶
func Discard[K comparable, V any](this, other map[K]V)
Discard removes all keys from this set that exist in the other set.
func Intersection ¶
func Intersection[K comparable, V any](this, other map[K]V) map[K]V
Intersection returns a new set containing only keys that exist in both sets.
func Keys ¶
func Keys[K comparable, V any](src map[K]V) []K
Keys returns a randomly-sorted slice of map keys.
func NewSetFromSlice ¶
func NewSetFromSlice[K comparable, V any](value V, keys ...K) map[K]V
NewSetFromSlice creates a set from the given slice, with each entry given the same sentinel value.
func RemoveAll ¶
func RemoveAll[K comparable, V any](set map[K]V, keys ...K)
RemoveAll removes multiple keys from this set.
func SortedKeys ¶
func SortedKeys[K constraints.Ordered, V any](src map[K]V) []K
SortedKeys returns a sorted slice of map keys.
func SortedValues ¶
func SortedValues[K comparable, V constraints.Ordered](src map[K]V) []V
SortedValues returns a sorted slice of map values.
func SubsetOf ¶
func SubsetOf[K comparable, V any](this, other map[K]V) bool
SubsetOf returns true if every key in this set is in the other set.
func Union ¶
func Union[K comparable, V any](this, other map[K]V) map[K]V
Union returns a new set containing all keys from both sets.
func Update ¶
func Update[K comparable, V any](this, other map[K]V)
Update adds every key from the other set to this set.
func Values ¶
func Values[K comparable, V any](src map[K]V) []V
Values returns a randomly-sorted slice of map values.
Types ¶
This section is empty.