Dave Cheney

Results 251 comments of Dave Cheney

Id love to do that, that was how it worked previously, but if the type is unnamed then it cannot host a Formatter method. On Fri, 5 Aug 2016, 03:44...

Maybe it can change, I haven't looked closely. It depends if people want to do st := err.Stack(); fmt.Printf("%+v", st); or if they want to fmt.Printf("%+v", err) On Fri, Aug...

Yes, this is how it works. I couldn’t think of an algorithm to collapse related stack frames. I recommend not using WithStack at intermediary levels as it adds little value....

Thank you for raising this issue. WithStack and WithMessage were added to allow the caller to add just a message or a stack trace if they want. In retrospect Wrap...

Not really. This was a deliberate choice to avoid using the string form of an error to transmit context between locations in the call stack > On 2 Aug 2018,...

Not til 1.9 is deprecated, which won't be til the end of the year i'd say.

Sure. Please include a benchmark to show the improvement in allocations. > On 13 Feb 2018, at 02:59, Chris Stockton wrote: > > Would you accept a bytes.Buffer pull request...

errors.Cause always unwraps as far as it can, ie to the bottom of the stack, or at least until you hit an error which does not implement `Cause`. What is...

The CPU profile is the one to start with. If you are using linux you might also find the perf tool (comes with your linux disto, not this project) useful

If you are using cpu profiling in a go test, support for generating a profile is built into the go test runner, use go test -cpuprofile=c.p