Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a2fd51

Browse files
committed
pkg/ioutils: deprecate NopWriteCloser
It was only used internally, and has no external consumers; deprecate it to be removed in the next release. Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 3faa170) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent cf37b66 commit 8a2fd51

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

container/stream/streams.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,15 @@ func (c *Config) NewInputPipes() {
8787

8888
// NewNopInputPipe creates a new input pipe that will silently drop all messages in the input.
8989
func (c *Config) NewNopInputPipe() {
90-
c.stdinPipe = ioutils.NopWriteCloser(io.Discard)
90+
c.stdinPipe = &nopWriteCloser{io.Discard}
9191
}
9292

93+
type nopWriteCloser struct {
94+
io.Writer
95+
}
96+
97+
func (w *nopWriteCloser) Close() error { return nil }
98+
9399
// CloseStreams ensures that the configured streams are properly closed.
94100
func (c *Config) CloseStreams() error {
95101
var errs []string

pkg/ioutils/writers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ type nopWriteCloser struct {
2121
func (w *nopWriteCloser) Close() error { return nil }
2222

2323
// NopWriteCloser returns a nopWriteCloser.
24+
//
25+
// Deprecated: This function is no longer used and will be removed in the next release.
2426
func NopWriteCloser(w io.Writer) io.WriteCloser {
2527
return &nopWriteCloser{w}
2628
}

0 commit comments

Comments
 (0)