From 1bb3a422fc889d0c17d65e25b2d3517e93c5a503 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Tue, 8 May 2018 19:01:07 +0100 Subject: [PATCH] Replacing strings.Builder with bytes.Buffer. For backward compatibility. --- widgets/gauge/gauge.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/widgets/gauge/gauge.go b/widgets/gauge/gauge.go index a31c5c8..d95d6fc 100644 --- a/widgets/gauge/gauge.go +++ b/widgets/gauge/gauge.go @@ -16,10 +16,10 @@ package gauge import ( + "bytes" "errors" "fmt" "image" - "strings" "sync" "unicode/utf8" @@ -172,15 +172,15 @@ func (g *Gauge) progressText() string { // gaugeText returns full text to be displayed within the gauge, i.e. the // progress text and the optional label. func (g *Gauge) gaugeText() string { - var sb strings.Builder - sb.WriteString(g.progressText()) + var b bytes.Buffer + b.WriteString(g.progressText()) if g.opts.textLabel != "" { - if sb.Len() > 0 { - sb.WriteString(" ") + if b.Len() > 0 { + b.WriteString(" ") } - sb.WriteString(fmt.Sprintf("(%s)", g.opts.textLabel)) + b.WriteString(fmt.Sprintf("(%s)", g.opts.textLabel)) } - return sb.String() + return b.String() } // drawText draws the text enumerating the progress and the text label.