From e31c2eb384d29c77c3a27344cde0ac50fa712318 Mon Sep 17 00:00:00 2001 From: Giedrius Jonikas Date: Thu, 31 Oct 2024 10:30:57 +0000 Subject: [PATCH] use bytes.Buffer instead of strings.Builder in RunStats() --- cli/command/container/stats.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/command/container/stats.go b/cli/command/container/stats.go index e969cf6c83f6..868603e69b3a 100644 --- a/cli/command/container/stats.go +++ b/cli/command/container/stats.go @@ -7,6 +7,7 @@ import ( "strings" "sync" "time" + "bytes" "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" @@ -267,7 +268,7 @@ func RunStats(ctx context.Context, dockerCLI command.Cli, options *StatsOptions) // Buffer to store formatted stats text. // Once formatted, it will be printed in one write to avoid screen flickering. - var statsTextBuffer strings.Builder + var statsTextBuffer bytes.Buffer statsCtx := formatter.Context{ Output: &statsTextBuffer,