Skip to content

Commit 06ab599

Browse files
authored
Merge pull request #4154 from thaJeztah/23.0_backport_fix_deprecation_message
[23.0 backport] cli/command: fix deprecation comments for Stream types
2 parents 683b099 + 6efc4ea commit 06ab599

1 file changed

Lines changed: 19 additions & 10 deletions

File tree

cli/command/streams.go

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
package command
22

33
import (
4+
"io"
5+
46
"github.com/docker/cli/cli/streams"
57
)
68

79
// InStream is an input stream used by the DockerCli to read user input
8-
// Deprecated: Use github.com/docker/cli/cli/streams.In instead
10+
//
11+
// Deprecated: Use [streams.In] instead.
912
type InStream = streams.In
1013

1114
// OutStream is an output stream used by the DockerCli to write normal program
1215
// output.
13-
// Deprecated: Use github.com/docker/cli/cli/streams.Out instead
16+
//
17+
// Deprecated: Use [streams.Out] instead.
1418
type OutStream = streams.Out
1519

16-
var (
17-
// NewInStream returns a new InStream object from a ReadCloser
18-
// Deprecated: Use github.com/docker/cli/cli/streams.NewIn instead
19-
NewInStream = streams.NewIn
20-
// NewOutStream returns a new OutStream object from a Writer
21-
// Deprecated: Use github.com/docker/cli/cli/streams.NewOut instead
22-
NewOutStream = streams.NewOut
23-
)
20+
// NewInStream returns a new [streams.In] from an [io.ReadCloser].
21+
//
22+
// Deprecated: Use [streams.NewIn] instead.
23+
func NewInStream(in io.ReadCloser) *streams.In {
24+
return streams.NewIn(in)
25+
}
26+
27+
// NewOutStream returns a new [streams.Out] from an [io.Writer].
28+
//
29+
// Deprecated: Use [streams.NewOut] instead.
30+
func NewOutStream(out io.Writer) *streams.Out {
31+
return streams.NewOut(out)
32+
}

0 commit comments

Comments
 (0)