code: func (s *attrStore) SetAttrs(id uint64, m map[string]interface{}) error {
  	// Ignore empty maps.
  	if len(m) == 0 {
  		return nil
  	}
  
  	// Check if the attributes already exist under a read-only lock.
  	if attr, err := s.Attrs(id); err != nil {
  		return errors.Wrap(err, "checking attrs")
  	} else if attr != nil && mapContains(attr, m) {
  		return nil
  	}
  
  	// Obtain write lock.
  	s.mu.Lock()
  	defer s.mu.Unlock()
  
  	var attr map[string]interface{}
  	if err := s.db.Update(func(tx *bolt.Tx) error {
  		tmp, err := txUpdateAttrs(tx, id, m)
  		if err != nil {
  			return err
  		}
  		attr = tmp
  
  		return nil
  	}); err != nil {
  		return errors.Wrap(err, "updating store")
  	}
  
  	// Swap attributes map in cache.
  	s.attrCache.Set(id, attr)
  
  	return nil
  }
docs: // SetAttrs sets attribute values for a given ID.