Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is similar to errgroup.Group, but it gives you an errors channel to listen to all of the errors from the goroutines.
func (*Group) Errors ¶
Errors returns a channel that will receive all of the errors from the goroutines. This channel will be closed when the group is done. This method should be called **BEFORE** loading any Go functions. otherwise you run the risk of missing errors.
wg := &Group{}
errs := wg.Errors()
wg.Go(func() error {
return nil
})
wg.Wait()
type Map ¶
type Map[K constraints.Ordered, V any] struct { // contains filtered or unexported fields }
Map is a synchronized map.
func NewMap ¶
func NewMap[K constraints.Ordered, V any](m map[K]V) *Map[K, V]
NewMap returns a new Map from the given map. If the map is nil, a new map is created.
func (*Map[K, V]) Clone ¶ added in v1.1.0
Clone returns a new Map with a copy of the underlying map.
func (*Map[K, V]) Delete ¶
Delete removes the item for the given key. Returns true if an item was in the map and deleted.
func (*Map[K, V]) Get ¶
Get returns the value for the given key. Returns false if the key does not exist in the map.
func (*Map[K, V]) Keys ¶
func (m *Map[K, V]) Keys() []K
Keys returns a sorted slice of the keys in the map.