code: func removeDescendants(c context.Context, kind string, ancestor *datastore.Key, preserve func(string) bool) error {
  	var toDelete []*datastore.Key
  	q := datastore.NewQuery(kind).Ancestor(ancestor).KeysOnly(true)
  	err := datastore.Run(c, q, func(key *datastore.Key) error {
  		id := key.StringID()
  		if preserve != nil && preserve(id) {
  			return nil
  		}
  		logging.Infof(c, "deleting entity %s", key.String())
  		toDelete = append(toDelete, key)
  		return nil
  	})
  	if err != nil {
  		return err
  	}
  	return datastore.Delete(c, toDelete)
  }
docs: // removeDescedants deletes all entities of a given kind under the ancestor.
  // If preserve is not nil and it returns true for a string id, the entity
  // is not deleted.