code: func (sub *subState) deleteFromList(sl []*subState) ([]*subState, bool) {
  	for i := 0; i < len(sl); i++ {
  		if sl[i] == sub {
  			sl[i] = sl[len(sl)-1]
  			sl[len(sl)-1] = nil
  			sl = sl[:len(sl)-1]
  			return shrinkSubListIfNeeded(sl), true
  		}
  	}
  	return sl, false
  }
docs: // Delete a sub from a given list.