-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
by kees.varekamp:
Example: package main import ( "container/list" "fmt" ) func main() { l := list.New() l.PushBack("A") l.PushBack("B") e := l.Front() l.Remove(e) fmt.Printf("len:%d list:%v\n",l.Len(),l) l.Remove(e) fmt.Printf("len:%d list:%v\n",l.Len(),l) } Output: len:1 list:&{0xb772b3c0 0xb772b3c0 1 0xb770d7f8} len:0 list:&{<nil> <nil> 0 0xb770d7f8} We're thinking the first Remove should remove e from the list, then the second should do nothing. But it seems to remove the next first element.