Golang container/list.List.Front() function example
package container/list
Front returns the first element of list l or nil.
Golang container/list.List.Front() function usage example
package main
import (
"container/list"
"fmt"
)
func main() {
alist := list.New()
alist.PushBack("a")
alist.PushBack("b")
alist.PushBack("c")
e := alist.Front()
fmt.Println(e.Value)
}
Output :
a
Reference :
Advertisement
Something interesting
Tutorials
+18.4k Golang : How to remove certain lines from a file
+13.8k Generate salted password with OpenSSL example
+7.9k Setting $GOPATH environment variable for Unix/Linux and Windows
+19.6k Golang : Set or Add HTTP Request Headers
+22.7k Golang : Round float to precision example
+29.3k Golang : Save map/struct to JSON or XML file
+10.9k Golang : Sieve of Eratosthenes algorithm
+13k Golang : Calculate elapsed years or months since a date
+14k Golang : Human readable time elapsed format such as 5 days ago
+7.4k Golang : Convert source code to assembly language
+30.4k Golang : How to redirect to new page with net/http?
+13.9k Golang : How to determine if a year is leap year?