Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A sample code of "container/list".
package main
import (
func main() {
l := list.New()
e4 := l.PushBack(4)
e1 := l.PushFront(1)
e := l.PushFront(1)
l.InsertBefore("e3", e4)
l.InsertAfter(nil, e1)
fmt.Println("len=", l.Len())
for e := l.Front(); e != nil; e = e.Next() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.