From 7d7ed67f718add8007792570eb6d10c68ef85412 Mon Sep 17 00:00:00 2001 From: Raul Silvera Date: Thu, 10 Mar 2016 17:17:16 -0800 Subject: [PATCH] Fix error handling threadz legacy profiles A Go redefinition error causes pprof to skip parsing profile mappings. --- profile/legacy_profile.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profile/legacy_profile.go b/profile/legacy_profile.go index 17c2224..964d28d 100644 --- a/profile/legacy_profile.go +++ b/profile/legacy_profile.go @@ -983,7 +983,8 @@ func parseAdditionalSections(l string, b *bytes.Buffer, p *Profile) (err error) break } // Ignore any unrecognized sections. - if l, err := b.ReadString('\n'); err != nil { + var err error + if l, err = b.ReadString('\n'); err != nil { if err != io.EOF { return err }