Write writes the string to the file.
(s string)
| 88 | |
| 89 | // Write writes the string to the file. |
| 90 | func (f File) Write(s string) error { |
| 91 | if f == "" { |
| 92 | return xerrors.Errorf("empty file path") |
| 93 | } |
| 94 | return write(string(f), 0o600, []byte(s)) |
| 95 | } |
| 96 | |
| 97 | // Read reads the file to a string. All leading and trailing whitespace |
| 98 | // is removed. |