Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapComparePresentOnly ¶ added in v0.6.0
func MapComparePresentOnly[K comparable, V comparable](a, b map[K]V) []K
MapComparePresentOnly compares 2 maps but only the keys that are present in both maps. Returns a slice of keys that are different
func MapDiff ¶ added in v0.3.0
func MapDiff[K comparable, V comparable](a, b map[K]V) map[K][]V
MapDiff returns diff as slices a_value,b_value. Missing values are represented as Zero values
func ResolveDependencies ¶ added in v0.3.0
func ResolveDependencies[D Dependency[T], T comparable](us []D) ([]D, error)
ResolveDependencies takes a slice of Elements that implement Dependency and returns a sorted slice. All Elements that provide a feature (Dependency.Provides()) are sorted before Elements which depends(Dependency.Depends()) on them If there is a dependency loop an error is return together the slice of the resolved Dependencies
Types ¶
type Dependency ¶ added in v0.3.0
type Dependency[T comparable] interface { Provides() T Depends() []T }
type LineNumberTracker ¶ added in v0.4.0
type LineNumberTracker []trackedLine
func (*LineNumberTracker) LineAtOffset ¶ added in v0.4.0
func (l *LineNumberTracker) LineAtOffset(offset int64) (int, int64)
LineAtOffset returns at which line/pos an offset byte was in the stream written to the LineNumberTracker. Returns -1 if offset was not read yet