Home »
Code Examples »
Golang Code Examples
Golang - Demonstrate the use ring.Len() function Code Example
The code for Demonstrate the use ring.Len() function
package main
import (
"container/ring"
"fmt"
)
func main() {
// A new ring of size 3
rng := ring.New(3)
// Printing its length
fmt.Println(rng.Len())
}
/*
Output:
3
*/
Code by IncludeHelp,
on February 28, 2023 16:25