You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bonzai/filter/filter_test.go

29 lines
537 B
Go

// Copyright 2022 Robert S. Muhlestein.
// SPDX-License-Identifier: Apache-2.0
3 years ago
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]
}