code: func (s *Store) DeleteUser(ctx context.Context, id platform.ID) error {
  	userID, err := id.Encode()
  	if err != nil {
  		return err
  	}
  
  	err = s.db.Update(func(tx *bolt.Tx) error {
  		b := tx.Bucket(s.bucket)
  		ub := b.Bucket(usersPath).Bucket(userID)
  		if ub == nil {
  			return backend.ErrUserNotFound
  		}
  		c := ub.Cursor()
  		i := 0
  		for k, _ := c.First(); k != nil; k, _ = c.Next() {
  			i++
  			// check for cancelation every 256 tasks deleted
  			if i&0xFF == 0 {
  				select {
  				case <-ctx.Done():
  					return ctx.Err()
  				default:
  				}
  			}
  			if err := b.Bucket(tasksPath).Delete(k); err != nil {
  				return err
  			}
  			if err := b.Bucket(taskMetaPath).Delete(k); err != nil {
  				return err
  			}
  			if err := b.Bucket(orgByTaskID).Delete(k); err != nil {
  				return err
  			}
  			if err := b.Bucket(userByTaskID).Delete(k); err != nil {
  				return err
  			}
  			if err := b.Bucket(nameByTaskID).Delete(k); err != nil {
  				return err
  			}
  
  			org := b.Bucket(orgByTaskID).Get(k)
  			if len(org) > 0 {
  				ob := b.Bucket(orgsPath).Bucket(org)
  				if ob != nil {
  					if err := ob.Delete(k); err != nil {
  						return err
  					}
  				}
  			}
  		}
  
  		// check for cancelation one last time before we return
  		select {
  		case <-ctx.Done():
  			return ctx.Err()
  		default:
  			return b.Bucket(usersPath).DeleteBucket(userID)
  		}
  	})
  
  	return err
  }
docs: // DeleteUser syncronously deletes a user and all their tasks from a bolt store.