code: func (r *Resolver) ResolveAllPlatforms(ctx context.Context, file *ensure.File) (map[template.Platform]*ensure.ResolvedFile, error) {
  	logging.Debugf(ctx, "Resolving for %d platform(s) in the ensure file...", len(file.VerifyPlatforms))
  
  	r.Client.BeginBatch(ctx)
  	defer r.Client.EndBatch(ctx)
  
  	type resolvedOrErr struct {
  		resolved *ensure.ResolvedFile
  		err      error
  	}
  	results := make([]resolvedOrErr, len(file.VerifyPlatforms))
  
  	// Note: errors are reported through 'results'.
  	parallel.FanOutIn(func(tasks chan<- func() error) {
  		for idx, plat := range file.VerifyPlatforms {
  			idx := idx
  			plat := plat
  			tasks <- func() error {
  				ret, err := r.Resolve(ctx, file, plat.Expander())
  				results[idx] = resolvedOrErr{ret, err}
  				return nil
  			}
  		}
  	})
  
  	// Collect all errors into a flat MultiError list sorted by platform.
  	out := make(map[template.Platform]*ensure.ResolvedFile, len(results))
  	var merr errors.MultiError
  	for idx, plat := range file.VerifyPlatforms {
  		err := results[idx].err
  		if err == nil {
  			out[plat] = results[idx].resolved
  			continue
  		}
  		if me, ok := err.(errors.MultiError); ok {
  			for _, err := range me {
  				merr = append(merr, fmt.Errorf("when resolving %s - %s", plat, err))
  			}
  		} else {
  			merr = append(merr, fmt.Errorf("when resolving %s - %s", plat, err))
  		}
  	}
  	if len(merr) != 0 {
  		return nil, merr
  	}
  	return out, nil
  }
docs: // ResolveAllPlatforms resolves the ensure file for all platform it is verified
  // for (see file.VerifyPlatforms list).
  //
  // Doesn't stop on a first error. Collects them all into a single multi-error.