// WriteFile writes the given bytes to the file at path, creating one if necessary. If appendTo is true, then the data
// will be prepended to the top of the file.
WriteFile writes the given bytes to the file at path, creating one if necessary. If appendTo is true, then the data
will be prepended to the top of the file.
// WriteFile writes the given bytes to the file at path creating one if necessary . If appendTo is true then the data // will be prepended to the top of the file .
func WriteFile(data []byte, path string, appendTo bool) error {
	if appendTo {
		exists, err := FileExists(path, false)
		if err != nil {
			return err
		}
		if exists {
			existingData, err := ioutil.ReadFile(path)
			if err != nil {
				return err
			}
			data = append(data, existingData...)
		}
	}
	return ioutil.WriteFile(path, data, 0644)
}
func WriteFile ( data [ ] byte , path string , appendTo bool ) error { if appendTo { exists , err := FileExists ( path , false ) if err != nil { return err } if exists { existingData , err := ioutil . ReadFile ( path ) if err != nil { return err } data = append ( data , existingData ... ) } } return ioutil . WriteFile ( path , data , 0644 ) }
WriteFile writes the given bytes to the file at path, creating one if necessary.
WriteFile writes the given bytes to the file at path creating one if necessary .