diff --git a/src/go/ast/commentmap.go b/src/go/ast/commentmap.go index 9f81493f64..4196e475d9 100644 --- a/src/go/ast/commentmap.go +++ b/src/go/ast/commentmap.go @@ -9,6 +9,7 @@ import ( "fmt" "go/token" "sort" + "strings" ) type byPos []*CommentGroup @@ -311,7 +312,7 @@ func (cmap CommentMap) String() string { } sort.Sort(byInterval(nodes)) - var buf bytes.Buffer + var buf strings.Builder fmt.Fprintln(&buf, "CommentMap {") for _, node := range nodes { comment := cmap[node] diff --git a/src/go/ast/scope.go b/src/go/ast/scope.go index 02691f8e54..8882212007 100644 --- a/src/go/ast/scope.go +++ b/src/go/ast/scope.go @@ -7,9 +7,9 @@ package ast import ( - "bytes" "fmt" "go/token" + "strings" ) // A Scope maintains the set of named language entities declared @@ -46,7 +46,7 @@ func (s *Scope) Insert(obj *Object) (alt *Object) { // Debugging support func (s *Scope) String() string { - var buf bytes.Buffer + var buf strings.Builder fmt.Fprintf(&buf, "scope %p {", s) if s != nil && len(s.Objects) > 0 { fmt.Fprintln(&buf)