Documentation ¶
Overview ¶
Package util provides a generic type representing a mathematical set, and convenience functions for generating error values for packages github.com/jub0bs/fcors and github.com/jub0bs/fcors/risky.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errorf ¶
Errorf works the same way as fmt.Errorf does, but prefixes the resulting error message with "fcors: ".
func InvalidOriginPatternErr ¶
InvalidOriginPatternErr returns an error about invalid origin pattern s.
func NewError ¶
NewError works the same way as errors.New does, but prefixes the resulting error message with "fcors: ".
func NewErrorRisky ¶
NewErrorRisky works the same way as errors.New does, but prefixes the resulting error message with "fcors/risky: ".
Types ¶
type Set ¶
type Set[E comparable] map[E]struct{}
A Set represents a mathematical set whose elements have type E. Don't expect this type to work properly for elements that are not reflexive for equality.
func NewSet ¶
func NewSet[E comparable](first E, rest ...E) Set[E]
NewSet returns a Set that contains all of es (and no other elements).