diff --git a/src/cmd/trace/annotations.go b/src/cmd/trace/annotations.go index 1c0dad56d8..a276d7b642 100644 --- a/src/cmd/trace/annotations.go +++ b/src/cmd/trace/annotations.go @@ -370,7 +370,7 @@ func (task *taskDesc) String() string { if task == nil { return "task " } - wb := new(bytes.Buffer) + wb := new(strings.Builder) fmt.Fprintf(wb, "task %d:\t%s\n", task.id, task.name) fmt.Fprintf(wb, "\tstart: %v end: %v complete: %t\n", task.firstTimestamp(), task.endTimestamp(), task.complete()) fmt.Fprintf(wb, "\t%d goroutines\n", len(task.goroutines)) @@ -872,7 +872,7 @@ func (h *durationHistogram) ToHTML(urlmaker func(min, max time.Duration) string) } } - w := new(bytes.Buffer) + w := new(strings.Builder) fmt.Fprintf(w, ``) for i := h.MinBucket; i <= h.MaxBucket; i++ { // Tick label. @@ -914,7 +914,7 @@ func (h *durationHistogram) String() string { } } - w := new(bytes.Buffer) + w := new(strings.Builder) for i := h.MinBucket; i <= h.MaxBucket; i++ { count := h.Buckets[i] bar := count * barWidth / maxCount