From: hopehook Date: Thu, 1 Sep 2022 13:40:08 +0000 (+0800) Subject: types2: use strings.Builder in errors.go X-Git-Tag: go1.20rc1~1284 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b2110bcdde636b77412778a8c1eab6e50163ca1c;p=gostls13.git 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 --- 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