MCPcopy
hub / github.com/minio/minio-go / ExampleCopy

Function ExampleCopy

pkg/set/example_test.go:144–158  ·  view source on GitHub ↗

ExampleCopy demonstrates copying a set

()

Source from the content-addressed store, hash-verified

142
143// ExampleCopy demonstrates copying a set
144func 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
161func ExampleSet_Equals() {

Callers

nothing calls this directly

Calls 5

CreateFunction · 0.92
CopyFunction · 0.92
ToSliceOrderedFunction · 0.92
AddMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected