Take a look at the following source code:
import "container/list"
type Stream struct {
list list.List
}
func (s Stream) Append(value interface{}) {
log.Println(s.list.Len())
s.list.PushBack(value)
log.Println(s.list.Len())
}
This code will keep on printing 0
and 1
all the time. Am I doing it wrong?