code: func NewFieldTranslator(dirname string, field string) (*FieldTranslator, error) {
  	err := os.MkdirAll(dirname, 0700)
  	if err != nil {
  		return nil, errors.Wrap(err, "making directory")
  	}
  	var initialID uint64
  	mdbs := &FieldTranslator{
  		curID: &initialID,
  		lock:  newBucketVLock(),
  	}
  	mdbs.idMap, err = leveldb.OpenFile(dirname+"/"+field+"-id", &opt.Options{})
  	if err != nil {
  		return nil, errors.Wrapf(err, "opening leveldb at %v", dirname+"/"+field+"-id")
  	}
  	iter := mdbs.idMap.NewIterator(nil, nil)
  	if iter.Last() {
  		key := iter.Key()
  		*mdbs.curID = binary.BigEndian.Uint64(key) + 1
  	}
  	mdbs.valMap, err = leveldb.OpenFile(dirname+"/"+field+"-val", &opt.Options{})
  	if err != nil {
  		return nil, errors.Wrapf(err, "opening leveldb at %v", dirname+"/"+field+"-val")
  	}
  	return mdbs, nil
  }
docs: // NewFieldTranslator creates a new FieldTranslator which uses LevelDB as
  // backing storage.