ExampleCopy demonstrates copying a set
()
| 142 | |
| 143 | // ExampleCopy demonstrates copying a set |
| 144 | func ExampleCopy() { |
| 145 | original := set.Create(1, 2, 3) |
| 146 | copied := set.Copy(original) |
| 147 | |
| 148 | // Modify the copy |
| 149 | copied.Add(4) |
| 150 | copied.Remove(1) |
| 151 | |
| 152 | fmt.Println("Original:", set.ToSliceOrdered(original)) |
| 153 | fmt.Println("Modified copy:", set.ToSliceOrdered(copied)) |
| 154 | |
| 155 | // Output: |
| 156 | // Original: [1 2 3] |
| 157 | // Modified copy: [2 3 4] |
| 158 | } |
| 159 | |
| 160 | // ExampleSet_Equals demonstrates checking set equality |
| 161 | func ExampleSet_Equals() { |
nothing calls this directly
no test coverage detected