code: func (d *ClientDigestsFile) Serialize(w io.Writer, version, versionFile string) error {
  	_, err := iotools.WriteTracker(w, func(w io.Writer) error {
  		fmt.Fprintf(w, "# This file was generated by\n")
  		fmt.Fprintf(w, "#\n")
  		fmt.Fprintf(w, "#  cipd selfupdate-roll -version-file %s \\\n", versionFile)
  		fmt.Fprintf(w, "#      -version %s\n", version)
  		fmt.Fprintf(w, "#\n")
  		fmt.Fprintf(w, "# Do not modify manually. All changes will be overwritten.\n")
  		fmt.Fprintf(w, "# Use 'cipd selfupdate-roll ...' to modify.\n\n")
  
  		// Align fields nicely.
  		max := []int{0, 0}
  		for _, e := range d.entries {
  			if l := len(e.plat); l > max[0] {
  				max[0] = l
  			}
  			if l := len(e.ref.HashAlgo.String()); l > max[1] {
  				max[1] = l
  			}
  		}
  
  		for _, e := range d.entries {
  			algo := strings.ToLower(e.ref.HashAlgo.String())
  			fmt.Fprintf(w, "%s%s%s%s%s\n",
  				e.plat, strings.Repeat(" ", max[0]+2-len(e.plat)),
  				algo, strings.Repeat(" ", max[1]+2-len(algo)),
  				e.ref.HexDigest,
  			)
  		}
  
  		return nil
  	})
  	return err
  }
docs: // Serialize writes the ClientDigestsFile to an io.Writer.
  //
  // 'version' and 'versionFile' are used to construct a meaningful comment
  // footer.