]> Cypherpunks.ru repositories - gostls13.git/commitdiff
types2: use strings.Builder in errors.go
authorhopehook <hopehook.com@gmail.com>
Thu, 1 Sep 2022 13:40:08 +0000 (21:40 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 1 Sep 2022 23:22:30 +0000 (23:22 +0000)
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 <gobot@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: hopehook <hopehook@golangcn.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/types2/errors.go

index 2a3e88a2fe095f89d4ef1721552b0da8ea99cdfd..61d89530140921dac805a8f2a0a393c8a63d0c6c 100644 (file)
@@ -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