code: func resolveEnsureFile(ctx context.Context, f *ensure.File, clientOpts clientOptions) (map[string][]pinInfo, ensure.VersionsFile, error) {
  	client, err := clientOpts.makeCIPDClient(ctx)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	out := ensure.VersionsFile{}
  	mu := sync.Mutex{}
  
  	resolver := cipd.Resolver{
  		Client:         client,
  		VerifyPresence: true,
  		Visitor: func(pkg, ver, iid string) {
  			mu.Lock()
  			out.AddVersion(pkg, ver, iid)
  			mu.Unlock()
  		},
  	}
  	results, err := resolver.ResolveAllPlatforms(ctx, f)
  	if err != nil {
  		return nil, nil, err
  	}
  	return resolvedFilesToPinMap(results), out, nil
  }
docs: ////////////////////////////////////////////////////////////////////////////////
  // Ensure-file related helpers.