code: func (m *MapFieldTranslator) GetID(val interface{}) (id uint64, err error) {
  	// We make everything a string before mapping it. There are some subtle
  	// issues that can occur with the map because it stores type information as
  	// well as the actual value.
  	valMap, valSlice := fmt.Sprintf("%s", val), val
  	if idv, ok := m.m.Load(valMap); ok {
  		if id, ok = idv.(uint64); !ok {
  			return 0, errors.Errorf("Got non uint64 value back from MapTranslator: %v", idv)
  		}
  		return id, nil
  	}
  	m.l.Lock()
  	if idv, ok := m.m.Load(valMap); ok {
  		m.l.Unlock()
  		if id, ok = idv.(uint64); !ok {
  			return 0, errors.Errorf("Got non uint64 value back from MapTranslator: %v", idv)
  		}
  		return id, nil
  	}
  	nextid := m.n.Next()
  	m.s = append(m.s, valSlice)
  	if uint64(len(m.s)) != nextid+1 {
  		panic(fmt.Sprintf("unexpected length of slice, nextid: %d, len: %d", nextid, len(m.s)))
  	}
  	m.m.Store(valMap, nextid)
  	m.l.Unlock()
  	return nextid, nil
  }
docs: // GetID returns the integer id associated with the given value. It allocates a
  // new ID if the value is not found.