Skip to content

Commit

Permalink
use bytes.Buffer instead of strings.Builder in RunStats()
Browse files Browse the repository at this point in the history
  • Loading branch information
Giedriusj1 committed Oct 31, 2024
1 parent a501398 commit e31c2eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cli/command/container/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"
"sync"
"time"
"bytes"

"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e31c2eb

Please sign in to comment.