From b2110bcdde636b77412778a8c1eab6e50163ca1c Mon Sep 17 00:00:00 2001 From: hopehook Date: Thu, 1 Sep 2022 21:40:08 +0800 Subject: [PATCH] types2: use strings.Builder in errors.go Permissible now because go1.17 is used for bootstrapping. Change-Id: Ia6f314f9314eda1cc42002dcbdfa551196df76f0 Reviewed-on: https://go-review.googlesource.com/c/go/+/427554 TryBot-Result: Gopher Robot Auto-Submit: Robert Griesemer Reviewed-by: Cuong Manh Le Run-TryBot: Robert Griesemer Reviewed-by: Robert Griesemer Run-TryBot: hopehook Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/types2/errors.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/types2/errors.go b/src/cmd/compile/internal/types2/errors.go index 2a3e88a2fe..61d8953014 100644 --- a/src/cmd/compile/internal/types2/errors.go +++ b/src/cmd/compile/internal/types2/errors.go @@ -300,8 +300,7 @@ func posFor(at poser) syntax.Pos { // stripAnnotations removes internal (type) annotations from s. func stripAnnotations(s string) string { - // Would like to use strings.Builder but it's not available in Go 1.4. - var b bytes.Buffer + var b strings.Builder for _, r := range s { // strip #'s and subscript digits if r < '₀' || '₀'+10 <= r { // '₀' == U+2080 -- 2.50.0