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

Function ExampleCreate

pkg/set/example_test.go:247–259  ·  view source on GitHub ↗

ExampleCreate demonstrates creating a set with initial values

()

Source from the content-addressed store, hash-verified

245
246// ExampleCreate demonstrates creating a set with initial values
247func ExampleCreate() {
248 // Create set with initial values
249 primes := set.Create(2, 3, 5, 7, 11, 13)
250
251 fmt.Println("Is 7 prime:", primes.Contains(7))
252 fmt.Println("Is 9 prime:", primes.Contains(9))
253 fmt.Println("Prime count:", len(primes))
254
255 // Output:
256 // Is 7 prime: true
257 // Is 9 prime: false
258 // Prime count: 6
259}
260
261// ExampleSet_complexCustomType demonstrates using Set with a complex comparable struct
262func ExampleSet_complexCustomType() {

Callers

nothing calls this directly

Calls 2

CreateFunction · 0.92
ContainsMethod · 0.45

Tested by

no test coverage detected