Golang container/list.Element.Next() function example
package container/list
Next returns the next list element or nil.
Golang container/list.Element.Next() function usage example
package main
import (
"container/list"
"fmt"
)
func main() {
alist := list.New()
alist.PushBack("a")
alist.PushBack("b")
alist.PushBack("c")
fmt.Println("Next")
for e := alist.Front(); e != nil; e = e.Next() {
fmt.Println(e.Value) // print out the elements
}
}
Output :
Next
a
b
c
Reference :
Advertisement
Something interesting
Tutorials
+9.2k Golang : Write multiple lines or divide string into multiple lines
+11.9k Golang : Convert decimal number(integer) to IPv4 address
+11.3k Golang : How to use if, eq and print properly in html template
+13.4k Golang : Generate Code128 barcode
+7.8k Golang : Regular Expression find string example
+29.3k Golang : Save map/struct to JSON or XML file
+5.6k PHP : Convert string to timestamp or datestamp before storing to database(MariaDB/MySQL)
+8.2k Golang : Metaprogramming example of wrapping a function
+10.2k Golang : How to profile or log time spend on execution?
+8.3k Golang : Auto-generate reply email with text/template package
+9.1k Golang : Get curl -I or head data from URL example
+7.3k Golang : How to fix html/template : "somefile" is undefined error?