Comment by guessmyname
5 hours ago
> Optimized fmt.Errorf — With the new Go release, this debate should finally be settled. For unformatted strings, fmt.Errorf now allocates less and generally matches the allocations for errors.New. Specifically, fmt.Errorf goes from 2 allocations to 0 allocations for a non-escaping error, and from 2 allocations to 1 allocation for an escaping error […]
Thank you so much!!! I used to always take an extra second to decide which one to use based on the function’s parameter(s), and now I feel like I’m getting that time back, no sarcasm at all. This is a genuinely great improvement.
No comments yet
Contribute on Hacker News ↗