cmd/cover: use strings.Builder

Change-Id: Ifb51cb4ed98a93742ce4b221137a0ad73b939b06
Reviewed-on: https://go-review.googlesource.com/c/go/+/428286
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
cuiweixie 2022-09-04 20:03:05 +08:00 committed by Gopher Robot
parent 33628ce195
commit 47faad111f
2 changed files with 2 additions and 3 deletions

View file

@ -400,7 +400,7 @@ func TestCoverHTML(t *testing.T) {
if err != nil {
t.Fatal(err)
}
var out bytes.Buffer
var out strings.Builder
scan := bufio.NewScanner(bytes.NewReader(entireHTML))
in := false
for scan.Scan() {

View file

@ -6,7 +6,6 @@ package main
import (
"bufio"
"bytes"
"cmd/internal/browser"
"fmt"
"html/template"
@ -157,7 +156,7 @@ func rgb(n int) string {
// colors generates the CSS rules for coverage colors.
func colors() template.CSS {
var buf bytes.Buffer
var buf strings.Builder
for i := 0; i < 11; i++ {
fmt.Fprintf(&buf, ".cov%v { color: %v }\n", i, rgb(i))
}