Golang container/list.List.MoveToBack() function example
package container/list
MoveToBack moves element e (1st parameter) to the back of the given list. If e is not an element of the list, the list is not modified.
Golang container/list.List.MoveToBack() function usage example
package main
import (
"container/list"
"fmt"
)
func main() {
alist := list.New()
alist.PushBack("a")
alist.PushBack("b")
e := alist.PushBack("c")
alist.PushBack("d")
alist.MoveToBack(e)
for e := alist.Front(); e != nil; e = e.Next() {
fmt.Println(e.Value) // print out the elements
}
}
Output :
a
b
d
c <---- moved to the back of the list
Reference :
Advertisement
Something interesting
Tutorials
+17k Golang : How to save log messages to file?
+8.2k Golang : Add build version and other information in executables
+9.1k Golang : Gonum standard normal random numbers example
+7.1k Golang : Array mapping with Interface
+5.7k Fix yum-complete-transaction error
+11.3k Golang : Characters limiter example
+14.4k Android Studio : Use image as AlertDialog title with custom layout example
+10.2k Golang : Find and replace data in all files recursively
+13.6k Golang : Strings comparison
+6.2k Golang & Javascript : How to save cropped image to file on server
+7.9k Javascript : How to check a browser's Do Not Track status?
+14.4k Golang : Parsing or breaking down URL