Write will write to the file and perform a Sync() if writing succeeds.
(b []byte)
| 43 | |
| 44 | // Write will write to the file and perform a Sync() if writing succeeds. |
| 45 | func (w *SyncWriter) Write(b []byte) error { |
| 46 | if _, err := w.w.Write(b); err != nil { |
| 47 | return err |
| 48 | } |
| 49 | return w.syncFn() |
| 50 | } |
| 51 | |
| 52 | // Close will call Close() on the underlying file |
| 53 | func (w *SyncWriter) Close() error { |