Diff returns a new set which is the difference set from `set` to `other`. Which means, all the items in `newSet` are in `set` but not in `other`.
()
| 137 | // Diff returns a new set which is the difference set from `set` to `other`. |
| 138 | // Which means, all the items in `newSet` are in `set` but not in `other`. |
| 139 | func ExampleIntSet_Diff() { |
| 140 | s1 := gset.NewIntSetFrom([]int{1, 2, 3}) |
| 141 | s2 := gset.NewIntSetFrom([]int{1, 2, 3, 4}) |
| 142 | fmt.Println(s2.Diff(s1).Slice()) |
| 143 | |
| 144 | // Output: |
| 145 | // [4] |
| 146 | } |
| 147 | |
| 148 | // Equal checks whether the two sets equal. |
| 149 | func ExampleIntSet_Equal() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…