diff --git a/internal/debug/api.go b/internal/debug/api.go index 232834d8c0..86a4218f6a 100644 --- a/internal/debug/api.go +++ b/internal/debug/api.go @@ -191,7 +191,7 @@ func (*HandlerT) WriteMemProfile(file string) error { // Stacks returns a printed representation of the stacks of all goroutines. func (*HandlerT) Stacks() string { - var buf bytes.Buffer + buf := new(bytes.Buffer) pprof.Lookup("goroutine").WriteTo(buf, 2) return buf.String() }