From ed530dbd077c8dbf680fabb1fb10da5239099e25 Mon Sep 17 00:00:00 2001 From: cuiweixie Date: Sun, 4 Sep 2022 19:18:50 +0800 Subject: testing: use strings.Builder Change-Id: Ied8a3019f1e21c0e74c798d2b1b279a606a38554 Reviewed-on: https://go-review.googlesource.com/c/go/+/428279 Reviewed-by: Bryan Mills TryBot-Result: Gopher Robot Run-TryBot: Bryan Mills Reviewed-by: Michael Knyszek --- src/testing/fuzz.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/testing/fuzz.go') diff --git a/src/testing/fuzz.go b/src/testing/fuzz.go index e60ecadf25..87b60fc1bb 100644 --- a/src/testing/fuzz.go +++ b/src/testing/fuzz.go @@ -5,7 +5,6 @@ package testing import ( - "bytes" "errors" "flag" "fmt" @@ -14,6 +13,7 @@ import ( "path/filepath" "reflect" "runtime" + "strings" "time" ) @@ -379,7 +379,7 @@ func (f *F) Fuzz(ff any) { // fuzz worker. This would become very verbose, particularly during // minimization. Return the error instead, and let the caller deal // with the output. - var buf bytes.Buffer + var buf strings.Builder if ok := run(&buf, e); !ok { return errors.New(buf.String()) } -- cgit v1.3-5-g9baa