code: func (i IndexFile) WriteFile(dest string, mode os.FileMode) error {
  	b, err := yaml.Marshal(i)
  	if err != nil {
  		return err
  	}
  	return ioutil.WriteFile(dest, b, mode)
  }
docs: // WriteFile writes an index file to the given destination path.
  //
  // The mode on the file is set to 'mode'.