Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PathSeparator = os.PathSeparator
Functions ¶
func Filter ¶
Filter sorts and filters the given items by matching them against the query. It returns a slice of items sorted by best match against the query.
Example (String) ¶
ss := []string{"Call", "Me", "Maybe"} res := fuzzaldrin.Filter(ss, "me", ident[string]) fmt.Println(strings.Join(res, "\n"))
Output: Me Maybe
Example (Struct) ¶
es := []entry{ {name: "Call", id: 1}, {name: "Me", id: 2}, {name: "Maybe", id: 3}, } res := fuzzaldrin.Filter[entry](es, "me", func(t entry) string { return t.name }) for _, i := range res { fmt.Println(i) }
Output: {Me 2} {Maybe 3}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.