Пример #1
0
Файл: io.go Проект: NetSys/quilt
func writeTo(file string, message string) error {
	a := afero.Afero{
		Fs: appFs,
	}

	f, err := a.OpenFile(file, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
	if err != nil {
		logrus.WithError(err).Errorf("Couldn't open %s for writing", file)
		return err
	}

	defer f.Close()
	_, err = f.WriteString(message)
	return err
}