Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleRing_Link (0.26 sec)

  1. src/container/ring/example_test.go

    	r = r.Move(3)
    
    	// Iterate through the ring and print its contents
    	r.Do(func(p any) {
    		fmt.Println(p.(int))
    	})
    
    	// Output:
    	// 3
    	// 4
    	// 0
    	// 1
    	// 2
    }
    
    func ExampleRing_Link() {
    	// Create two rings, r and s, of size 2
    	r := ring.New(2)
    	s := ring.New(2)
    
    	// Get the length of the ring
    	lr := r.Len()
    	ls := s.Len()
    
    	// Initialize r with 0s
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 2.9K bytes
    - Viewed (0)
Back to top