aboutsummaryrefslogtreecommitdiff
path: root/src/testing/sub_test.go
diff options
context:
space:
mode:
authorcuiweixie <cuiweixie@gmail.com>2022-09-04 19:18:50 +0800
committerDaniel Martí <mvdan@mvdan.cc>2022-09-07 07:03:10 +0000
commited530dbd077c8dbf680fabb1fb10da5239099e25 (patch)
tree77eef2e44c8ca7827498582404dfe1088bda256b /src/testing/sub_test.go
parentf4bf9bceac20868fb692bacf02ee5b4ccd99b778 (diff)
downloadgo-ed530dbd077c8dbf680fabb1fb10da5239099e25.tar.xz
testing: use strings.Builder
Change-Id: Ied8a3019f1e21c0e74c798d2b1b279a606a38554 Reviewed-on: https://go-review.googlesource.com/c/go/+/428279 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/testing/sub_test.go')
-rw-r--r--src/testing/sub_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testing/sub_test.go b/src/testing/sub_test.go
index bb1715b23f..6d8badfbf8 100644
--- a/src/testing/sub_test.go
+++ b/src/testing/sub_test.go
@@ -477,7 +477,7 @@ func TestTRun(t *T) {
for _, tc := range testCases {
t.Run(tc.desc, func(t *T) {
ctx := newTestContext(tc.maxPar, newMatcher(regexp.MatchString, "", ""))
- buf := &bytes.Buffer{}
+ buf := &strings.Builder{}
root := &T{
common: common{
signal: make(chan bool),
@@ -664,7 +664,7 @@ func TestBRun(t *T) {
for _, tc := range testCases {
t.Run(tc.desc, func(t *T) {
var ok bool
- buf := &bytes.Buffer{}
+ buf := &strings.Builder{}
// This is almost like the Benchmark function, except that we override
// the benchtime and catch the failure result of the subbenchmark.
root := &B{