Writer is in an implementation of the "sticky error writer" pattern as described in https://blog.golang.org/errors-are-values. A Writer makes one call on the underlying writer for each call to Write, until an error is returned. From that point on, it makes no calls on the underlying writer, and ret
| 18 | // it makes no calls on the underlying writer, |
| 19 | // and returns the same error value every time. |
| 20 | type Writer struct { |
| 21 | w io.Writer |
| 22 | n int64 |
| 23 | err error |
| 24 | } |
| 25 | |
| 26 | // Write makes one call on the underlying writer |
| 27 | // if no error has previously occurred. |
nothing calls this directly
no outgoing calls
no test coverage detected