code: func specToEnsureFile(spec *vpython.Spec) (ef *ensure.File, packages []*vpython.Spec_Package) {
  	// Create a single package list. Our VirtualEnv will be index 0 (need
  	// this so we can back-port it into its VirtualEnv property).
  	//
  	// These will be updated to their resolved values in-place.
  	packages = make([]*vpython.Spec_Package, 1, 1+len(spec.Wheel))
  	packages[0] = spec.Virtualenv
  	packages = append(packages, spec.Wheel...)
  
  	pslice := make(ensure.PackageSlice, len(packages))
  	for i, pkg := range packages {
  		pslice[i] = ensure.PackageDef{
  			PackageTemplate:   pkg.Name,
  			UnresolvedVersion: pkg.Version,
  		}
  	}
  
  	ef = &ensure.File{
  		PackagesBySubdir: map[string]ensure.PackageSlice{"": pslice},
  	}
  	return
  }
docs: // specToEnsureFile translates the packages named in spec into a CIPD ensure
  // file.
  //
  // It returns an ensure file, ef, containing a specification that loads the
  // contents of each package into the CIPD root (""). It also returns packages,
  // a slice of pointers to spec's "vpython.Spec_Package" entries. Each PackageDef
  // index in ef corresponds to the same index source vpython.Spec_Package from
  // spec.