Golang container/list.New() function example
package container/list
New returns an initialized list.
Golang container/list.New() function usage example
package main
import (
"container/list"
"fmt"
)
func main() {
alist := list.New()
fmt.Println(alist.Len()) // list size before
alist.PushBack("a")
alist.PushBack("b")
alist.PushBack("c")
fmt.Println(alist.Len()) // list size after
}
Output :
0
3
Reference :
Advertisement
Something interesting
Tutorials
+9.4k Golang : Interfacing with PayPal's IPN(Instant Payment Notification) example
+10.5k Golang : Handle API query by curl with Gorilla Queries example
+7.1k Golang : How To Use Panic and Recover
+8k Random number generation with crypto/rand in Go
+3.5k Golang : Valued expressions and functions example
+12.7k Golang : Get current time
+9.1k Golang : Allow Cross-Origin Resource Sharing request
+12k Golang : Convert(cast) int to int64
+6.1k Nginx : How to block user agent ?
+5.9k Linux : How to fix Brother HL-1110 printing blank page problem
+5.5k Unix/Linux : How to get own IP address ?
+6k Golang : Get environment variable