code: func (idx *index) insert(id uint64, offset int64) {
  	idx.n++
  
  	// Add to reverse lookup.
  	idx.offsetsByID[id] = offset
  
  	// Grow the map if we've run out of slots.
  	if idx.n > idx.threshold {
  		elems, capacity := idx.elems, uint64(len(idx.elems))
  		idx.alloc(uint64(len(idx.elems) * 2))
  
  		for i := uint64(0); i < capacity; i++ {
  			e := &elems[i]
  			if e.hash == 0 {
  				continue
  			}
  			idx.insertIDbyOffset(e.offset, e.id)
  		}
  	}
  
  	// If the key was overwritten then decrement the size.
  	if overwritten := idx.insertIDbyOffset(offset, id); overwritten {
  		idx.n--
  	}
  }
docs: // insert adds the id/offset pair to the index.
  // This function will resize the map if it crosses the threshold.