package server type automap map[int]interface{} func (m automap) add(v interface{}) int { for k := 0;; k++ { if _, ok := m[k]; !ok { m[k] = v return k } } }