MCPcopy
hub / github.com/gogf/gf / ExampleIntSet_Diff

Function ExampleIntSet_Diff

container/gset/gset_z_example_int_test.go:139–146  ·  view source on GitHub ↗

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`.

()

Source from the content-addressed store, hash-verified

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`.
139func 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.
149func ExampleIntSet_Equal() {

Callers

nothing calls this directly

Calls 3

NewIntSetFromFunction · 0.92
SliceMethod · 0.45
DiffMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…