mirror of
https://github.com/golang/go
synced 2024-10-14 03:43:28 +00:00
go/parser: use strings.Builder
Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
parent
ba1ef54c1e
commit
7b358c685a
|
@ -5,7 +5,6 @@
|
|||
package parser
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"go/ast"
|
||||
"go/token"
|
||||
|
@ -298,7 +297,7 @@ type s3b struct { a, b *s3b; c []float }
|
|||
"float " // s3a
|
||||
|
||||
// collect unresolved identifiers
|
||||
var buf bytes.Buffer
|
||||
var buf strings.Builder
|
||||
for _, u := range f.Unresolved {
|
||||
buf.WriteString(u.Name)
|
||||
buf.WriteByte(' ')
|
||||
|
@ -382,7 +381,7 @@ func getField(file *ast.File, fieldname string) *ast.Field {
|
|||
|
||||
// Don't use ast.CommentGroup.Text() - we want to see exact comment text.
|
||||
func commentText(c *ast.CommentGroup) string {
|
||||
var buf bytes.Buffer
|
||||
var buf strings.Builder
|
||||
if c != nil {
|
||||
for _, c := range c.List {
|
||||
buf.WriteString(c.Text)
|
||||
|
|
Loading…
Reference in a new issue