code: func (b *batch) Write() error {
  	b.db.lock.Lock()
  	defer b.db.lock.Unlock()
  
  	for _, keyvalue := range b.writes {
  		if keyvalue.delete {
  			delete(b.db.db, string(keyvalue.key))
  			continue
  		}
  		b.db.db[string(keyvalue.key)] = keyvalue.value
  	}
  	return nil
  }
docs: // Write flushes any accumulated data to the memory database.