What is the comparable interface called in golang?
I'm working on a simple linked list implementation in golang for learning purposes. The definition of an element is below: type Element struct { next, prev *Element Value interface{} } As you can see, the Value can be anything that satisfies the empty interface. Now, as a new feature, I would like to make it so that when you insert a new element into the list, it inserts it in a sorted manner - each element will be <= the next. In order to do this, I wrote the following method: func (l *LinkedList) Add(val interface{}) *Element { this := &l.Root e := Element{Value: val} for { if this.next