From 4b78dc708647f3e47268bbd937be235903246dc7 Mon Sep 17 00:00:00 2001 From: Thomas Hipp Date: Thu, 2 Nov 2023 13:56:19 +0100 Subject: [PATCH] client: Use io.Writer for Stdout/Stderr in InstanceExecArgs 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 --- client/interfaces.go | 4 ++-- shared/ws/mirror.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/interfaces.go b/client/interfaces.go index 504f1a2cb514..86d53c7c3c9f 100644 --- a/client/interfaces.go +++ b/client/interfaces.go @@ -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) diff --git a/shared/ws/mirror.go b/shared/ws/mirror.go index 1da817367a1f..a6aaeafc7bcb 100644 --- a/shared/ws/mirror.go +++ b/shared/ws/mirror.go @@ -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)