ref: ab174c473618dd3743881cf44e02c2db4d1ecd5f
dir: /common/iowrap/nop_flush.go/
package iowrap
import "io"
type nopFlusher struct {
io.Writer
}
// NopFlush adapts writer into a WriteFlusher with a no-op Flush.
func NopFlush(writer io.Writer) WriteFlusher {
if writer == nil {
return nil
}
return nopFlusher{Writer: writer}
}
func (nopFlusher) Flush() error {
return nil
}