Documentation
¶
Overview ¶
Package maputil provides utilities for working with maps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortedKeys ¶
SortedKeys returns the keys of a map sorted in ascending order.
Types ¶
type Set ¶ added in v0.2.0
type Set[T comparable] map[T]struct{}
Set is a generic set type that serializes to/from JSON arrays.
func NewSet ¶ added in v0.2.0
func NewSet[T comparable](values ...T) Set[T]
NewSet creates a Set from values.
func (Set[T]) MarshalJSON ¶ added in v0.2.0
MarshalJSON implements json.Marshaler.
func (Set[T]) Remove ¶ added in v0.2.0
func (s Set[T]) Remove(value T)
Remove removes a value from the set.
func (*Set[T]) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON implements json.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.