code: func multiGetTags(c context.Context, keys []*datastore.Key, cb func(*datastore.Key, *model.Tag) error) error {
  	tags := make([]model.Tag, len(keys))
  	for i, k := range keys {
  		tags[i] = model.Tag{
  			ID:       k.StringID(),
  			Instance: k.Parent(),
  		}
  	}
  
  	errAt := func(idx int) error { return nil }
  	if err := datastore.Get(c, tags); err != nil {
  		merr, ok := err.(errors.MultiError)
  		if !ok {
  			return errors.Annotate(err, "GetMulti RPC error when fetching %d tags", len(tags)).Tag(transient.Tag).Err()
  		}
  		errAt = func(idx int) error { return merr[idx] }
  	}
  
  	for i, t := range tags {
  		switch err := errAt(i); {
  		case err == datastore.ErrNoSuchEntity:
  			continue
  		case err != nil:
  			return errors.Annotate(err, "failed to fetch tag entity with key %s", keys[i]).Err()
  		}
  		if err := cb(keys[i], &t); err != nil {
  			return err
  		}
  	}
  	return nil
  }
docs: // multiGetTags fetches a bunch of tags using GetMulti.
  //
  // On overall RPC error returns a transient error.
  //
  // If it managed to fetch something, calls cb(key, tag) sequentially for
  // all tags there were found (silently skipping missing ones). If a tag was not
  // fetched for some other reason, returns the error right away.
  //
  // If the callback returns an error this error is returned immediately by
  // multiGetTags.