Documentation ¶
Index ¶
- func BestMatchMap[K comparable, V any](m map[K]V, pattern K, threshold float32, f func(K, K) float32) (V, bool)
- func CountSlice[T comparable](s []T, v T) int
- func IndexSlice[T comparable](s []T, v T, begin int) int
- func InsertList[S ~[]E, E any](s S, pos int, i ...E) S
- func MatchMap[V any](m map[string]V, pattern string, f func(string, V) error) error
- func MatchMapReg[V any](m map[string]V, reg *regexp.Regexp, f func(string, V) error) error
- func MatchMapWildcard[V any](m map[string]V, pattern string, f func(string, V) error) error
- func MatchMapWith[T comparable, V any](m map[T]V, match func(T) bool, f func(T, V) error) error
- func MergeMap[T comparable, V any](l map[T]V, r map[T]V, update bool) map[T]V
- func SliceHas[T comparable](s []T, v T) bool
- func SliceMatchWith[T any](s []T, match func(T) bool) []T
- func SliceResize[T any](s []T, size int) []T
- func SliceReverse[T any](s []T) []T
- func StringSliceMatch(s []string, pattern string) []string
- func StringSliceMatchReg(s []string, reg *regexp.Regexp) []string
- func StringSliceMatchWildcard(s []string, pattern string) []string
- type Lesser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BestMatchMap ¶ added in v0.2.2
func BestMatchMap[K comparable, V any](m map[K]V, pattern K, threshold float32, f func(K, K) float32) (V, bool)
func CountSlice ¶ added in v0.2.1
func CountSlice[T comparable](s []T, v T) int
func IndexSlice ¶ added in v0.2.1
func IndexSlice[T comparable](s []T, v T, begin int) int
func InsertList ¶
insert in Array, Slice, or String
func MatchMapReg ¶ added in v0.2.3
func MatchMapWildcard ¶ added in v0.2.3
'*' - matches zero or more characters '?' - matches one character
func MatchMapWith ¶ added in v0.2.3
func MatchMapWith[T comparable, V any](m map[T]V, match func(T) bool, f func(T, V) error) error
func MergeMap ¶
func MergeMap[T comparable, V any](l map[T]V, r map[T]V, update bool) map[T]V
func SliceHas ¶ added in v0.2.3
func SliceHas[T comparable](s []T, v T) bool
func SliceMatchWith ¶ added in v0.2.3
func SliceResize ¶ added in v0.2.2
func SliceReverse ¶ added in v0.2.4
func SliceReverse[T any](s []T) []T
func StringSliceMatch ¶ added in v0.2.3
func StringSliceMatchReg ¶ added in v0.2.3
func StringSliceMatchWildcard ¶ added in v0.2.3
Types ¶
Click to show internal directories.
Click to hide internal directories.