Skip to content

Commit

Permalink
client: Use io.Writer for Stdout/Stderr in InstanceExecArgs
Browse files Browse the repository at this point in the history
This changes the Stdout and Stderr fields to be of type io.Writer
instead of io.WriteCloser since `Close()` is never called on these
fields.

Fixes #12197

Signed-off-by: Thomas Hipp <[email protected]>
  • Loading branch information
monstermunchkin committed Nov 2, 2023
1 parent e57a070 commit 4b78dc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,10 @@ type InstanceExecArgs struct {
Stdin io.ReadCloser

// Standard output
Stdout io.WriteCloser
Stdout io.Writer

// Standard error
Stderr io.WriteCloser
Stderr io.Writer

// Control message handler (window resize, signals, ...)
Control func(conn *websocket.Conn)
Expand Down
4 changes: 2 additions & 2 deletions shared/ws/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func MirrorRead(conn *websocket.Conn, rc io.ReadCloser) chan error {
return chDone
}

// MirrorWrite is a uni-directional mirror which replicates a websocket to an io.WriteCloser.
func MirrorWrite(conn *websocket.Conn, wc io.WriteCloser) chan error {
// MirrorWrite is a uni-directional mirror which replicates a websocket to an io.Writer.
func MirrorWrite(conn *websocket.Conn, wc io.Writer) chan error {
chDone := make(chan error, 1)
if wc == nil {
close(chDone)
Expand Down

0 comments on commit 4b78dc7

Please sign in to comment.