Golang container/ring.New() function example
package container/ring
New creates a ring with the given input (n) elements.
Golang container/ring.New() function usage example
package main
import (
"container/ring"
"fmt"
)
func main() {
r := ring.New(10)
fmt.Printf("Ring size is : %d\n", r.Len())
}
Output :
Ring size is : 10
Reference :
Advertisement
Something interesting
Tutorials
+19.2k Golang : Delete item from slice based on index/key position
+11.5k Use systeminfo to find out installed Windows Hotfix(s) or updates
+18.9k Golang : Read input from console line
+12.8k Golang : http.Get example
+9.7k Golang : List available AWS regions
+14.6k Golang : Execute function at intervals or after some delay
+30k Golang : Get time.Duration in year, month, week or day
+6.8k Unix/Linux : How to fix CentOS yum duplicate glibc or device-mapper-libs dependency error?
+15.6k Golang : Convert date format and separator yyyy-mm-dd to dd-mm-yyyy
+7.1k Golang : Get Alexa ranking data example
+14.8k Golang : Get URI segments by number and assign as variable example