collects

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoValues = fmt.Errorf("no values")

Functions

This section is empty.

Types

type Set

type Set[E comparable] map[E]any

func (*Set[E]) Add

func (s *Set[E]) Add(e ...E)

func (Set[E]) Iter

func (s Set[E]) Iter() iter.Seq[E]

func (*Set[E]) Remove

func (s *Set[E]) Remove(e E)

type WithSources

type WithSources[Value comparable, Source ~string] map[Value][]Source

Collects different values with their sources

func (*WithSources[V, S]) Collect

func (vs *WithSources[V, S]) Collect(value V, source S)

func (WithSources[Value, Source]) Combine

func (vs WithSources[Value, Source]) Combine() []Value

func (WithSources[V, S]) One

func (vs WithSources[V, S]) One() (V, error)

Returns "the value" if there is only one. Or returns an error which lists all contradicting values with sources

Jump to

Keyboard shortcuts

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