This commit is contained in:
Péter Szilágyi 2018-06-14 15:26:51 +03:00 committed by GitHub
parent 205b26bf13
commit 53e5166eb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.