Documentation ¶
Index ¶
- func All(set []interface{}) (subsets [][]interface{})
- func AllInt(set []int) (subsets [][]int)
- func AllIntWithLen(set []int, minLen, maxLen int) (subsets [][]int)
- func AllString(set []string) (subsets [][]string)
- func AllStringWithLen(set []string, minLen, maxLen int) (subsets [][]string)
- func AllWithLen(set []interface{}, minLen, maxLen int) (subsets [][]interface{})
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
func All(set []interface{}) (subsets [][]interface{})
All returns all combinations for a given interface array. This is essentially a powerset of the given set except that the empty set is disregarded.
func AllIntWithLen ¶
func AllString ¶
Example ¶
combinations := AllString([]string{"A", "B", "C"}) fmt.Println(combinations)
Output: [[A] [B] [A B] [C] [A C] [B C] [A B C]]
func AllStringWithLen ¶
Example ¶
ss := AllStringWithLen([]string{"A", "B", "C"}, 1, 2) fmt.Println(ss)
Output: [[A] [B] [A B] [C] [A C] [B C]]
func AllWithLen ¶
func AllWithLen(set []interface{}, minLen, maxLen int) (subsets [][]interface{})
All returns all combinations for a given interface array and fixed set length. This is essentially a powerset of the given set except that the empty set is disregarded.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.