1
0
mirror of https://github.com/golang/go synced 2024-11-18 14:54:40 -07:00

internal/trace: use strings.Builder

Change-Id: Ic7f827b8ee758c991ed76be65026b0330207deea
Reviewed-on: https://go-review.googlesource.com/c/go/+/428262
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
cuiweixie 2022-09-04 18:02:51 +08:00 committed by Daniel Martí
parent 1c50484335
commit 8a32354219

View File

@ -973,7 +973,7 @@ func PrintEvent(ev *Event) {
func (ev *Event) String() string {
desc := EventDescriptions[ev.Type]
w := new(bytes.Buffer)
w := new(strings.Builder)
fmt.Fprintf(w, "%v %v p=%v g=%v off=%v", ev.Ts, desc.Name, ev.P, ev.G, ev.Off)
for i, a := range desc.Args {
fmt.Fprintf(w, " %v=%v", a, ev.Args[i])