20 lines
252 B
Go
20 lines
252 B
Go
package noop
|
|
|
|
import "io"
|
|
|
|
type Flusher interface {
|
|
io.WriteCloser
|
|
|
|
Flush() error
|
|
}
|
|
|
|
type NoOpFlusher struct {
|
|
io.WriteCloser
|
|
}
|
|
|
|
func (NoOpFlusher) Flush() error { return nil }
|
|
|
|
func AddFlush(w io.WriteCloser) NoOpFlusher {
|
|
return NoOpFlusher{w}
|
|
}
|