Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n < len(p). Write must not modify the slice data, even tempo
(p []byte)
| 162 | // |
| 163 | // Implementations must not retain p. |
| 164 | func (fh *WriteFileHandle) Write(p []byte) (n int, err error) { |
| 165 | fh.mu.Lock() |
| 166 | defer fh.mu.Unlock() |
| 167 | // Since we can't seek, just call WriteAt with the current offset |
| 168 | return fh.writeAt(p, fh.offset) |
| 169 | } |
| 170 | |
| 171 | // WriteString a string to the file |
| 172 | func (fh *WriteFileHandle) WriteString(s string) (n int, err error) { |
no test coverage detected