Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Longest ¶
Longest will convert everything to.String and return the length of the longest string in the set.
Example ¶
package main import ( "fmt" "github.com/rwxrob/bonzai/fn/redu" ) func main() { set := []string{ "some thing", "i'm the longest", "here", } fmt.Println(redu.Longest(set)) }
Output: 15
func Unique ¶
func Unique[T comparable](set []T) []T
Unique removed duplicates.
Example ¶
package main import ( "github.com/rwxrob/bonzai/fn/each" "github.com/rwxrob/bonzai/fn/redu" ) func main() { set := []string{ "some thing", "some thing", "i'm the longest", "here", "here", "here", } each.Println(redu.Unique(set)) }
Output: some thing i'm the longest here
Types ¶
Click to show internal directories.
Click to hide internal directories.