Difference returns a new set which contains items which are in the first set but not in the others.
(set1 Set, sets ...Set)
| 281 | // Difference returns a new set which contains items which are in the first |
| 282 | // set but not in the others. |
| 283 | func Difference(set1 Set, sets ...Set) Set { |
| 284 | s := set1.Copy() |
| 285 | for _, set := range sets { |
| 286 | s.Subtract(set) |
| 287 | } |
| 288 | return s |
| 289 | } |
| 290 | |
| 291 | // Intersection returns a new set which contains items that only exist in all |
| 292 | // given sets. |