diff --git a/internal/debug/api.go b/internal/debug/api.go index 3118777eed..232834d8c0 100644 --- a/internal/debug/api.go +++ b/internal/debug/api.go @@ -191,9 +191,9 @@ func (*HandlerT) WriteMemProfile(file string) error { // Stacks returns a printed representation of the stacks of all goroutines. func (*HandlerT) Stacks() string { - var b bytes.Buffer - pprof.Lookup("goroutine").WriteTo(w, 2) - return b.String() + var buf bytes.Buffer + pprof.Lookup("goroutine").WriteTo(buf, 2) + return buf.String() } // FreeOSMemory returns unused memory to the OS.