refactor: Decompose key checks

This commit is contained in:
Felix Pojtinger
2021-12-02 23:10:34 +01:00
parent 96afddeb22
commit 7d4214c328
10 changed files with 58 additions and 84 deletions
+19
View File
@@ -0,0 +1,19 @@
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}
}
+13
View File
@@ -0,0 +1,13 @@
package noop
import "io"
type NoOpCloser struct {
io.Writer
}
func (NoOpCloser) Close() error { return nil }
func AddClose(w io.Writer) NoOpCloser {
return NoOpCloser{w}
}