]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof/internal/profile: make error message readable
authorIan Lance Taylor <iant@golang.org>
Thu, 27 Feb 2020 19:24:24 +0000 (11:24 -0800)
committerIan Lance Taylor <iant@golang.org>
Sun, 1 Mar 2020 02:22:06 +0000 (02:22 +0000)
commit2172b229b95f483324825806f692303a0a132762
tree1876950b18102446ab4762937d2e3579685294e6
parentc1abd5ab70e1e8ac59a2960d41fe6d83d68ea69b
runtime/pprof/internal/profile: make error message readable

The error message for an unrecognized type in decodeField was using
string(i) for an int type i. It was recently changed (by  me) to
string(rune(i)), but that just avoided a vet warning without fixing
the problem. This CL fixes the problem by using fmt.Errorf.

We also change the message to "unknown wire type" to match the master
copy of this code in github.com/google/pprof/profile/proto.go.

Updates #32479

Change-Id: Ia91ea6d5edbd7cd946225d1ee96bb7623b52bb44
Reviewed-on: https://go-review.googlesource.com/c/go/+/221384
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
src/runtime/pprof/internal/profile/proto.go