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

Function ExampleIntSet_Equal

container/gset/gset_z_example_int_test.go:149–161  ·  view source on GitHub ↗

Equal checks whether the two sets equal.

()

Source from the content-addressed store, hash-verified

147
148// Equal checks whether the two sets equal.
149func ExampleIntSet_Equal() {
150 s1 := gset.NewIntSetFrom([]int{1, 2, 3})
151 s2 := gset.NewIntSetFrom([]int{1, 2, 3, 4})
152 fmt.Println(s2.Equal(s1))
153
154 s3 := gset.NewIntSetFrom([]int{1, 2, 3})
155 s4 := gset.NewIntSetFrom([]int{1, 2, 3})
156 fmt.Println(s3.Equal(s4))
157
158 // Output:
159 // false
160 // true
161}
162
163// Intersect returns a new set which is the intersection from `set` to `other`.
164// Which means, all the items in `newSet` are in `set` and also in `other`.

Callers

nothing calls this directly

Calls 2

NewIntSetFromFunction · 0.92
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…