mirror of
https://github.com/rwxrob/bonzai
synced 2024-11-08 19:10:25 +00:00
26 lines
457 B
Go
26 lines
457 B
Go
|
package filter_test
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/rwxrob/bonzai/filter"
|
||
|
)
|
||
|
|
||
|
func ExampleHasPrefix() {
|
||
|
set := []string{
|
||
|
"one", "two", "three", "four", "five", "six", "seven",
|
||
|
}
|
||
|
fmt.Println(filter.HasPrefix(set, "t"))
|
||
|
// Output:
|
||
|
// [two three]
|
||
|
}
|
||
|
|
||
|
func ExampleMinus() {
|
||
|
set := []string{
|
||
|
"one", "two", "three", "four", "five", "six", "seven",
|
||
|
}
|
||
|
fmt.Println(filter.Minus(set, []string{"two", "four", "six"}))
|
||
|
// Output:
|
||
|
// [one three five seven]
|
||
|
}
|