Why do golang list / ring types use additional Element / Ring structures for individual elements, and not for the {} interface? I suppose there is some benefit, but I do not see it.
Edit: I wanted to ask about api and NOT about using Element / Ring in an implementation. An implementation may still use a non-exportable type, but has an api to give and receive interface {}, so why would users go in and out of Element / Ring?
Edit2: As an example, the Back () function might look like
func (l *List) Back() interface{} {
if l.len == 0 {
return nil
}
return l.root.prev.Value
}
If the list still uses the element inside, but it will just be the element (not exported), since it will not return it, but only return the value.