e.next = nil // avoid memory leaks e.prev = nil // avoid memory leaks 内存泄漏
/Go/src/container/list/list.go:10
// remove removes e from its list, decrements l.len, and returns e.
func (l *List) remove(e *Element) *Element {
e.prev.next = e.next
e.next.prev = e.prev
e.next = nil // avoid memory leaks
e.prev = nil // avoid memory leaks
e.list = nil
l.len--
return e
}