Hacker News new | ask | show | jobs
by scrollaway 2605 days ago
What's the point of making it a format string if you are hardcoding where the % identifier goes anyway?!
2 comments

The %w (or %v) identifier must be at the end for the magic to work, but you can still meaningfully format things in front of the wrapped error, e.g. fmt.Errorf("Write(%s): %w", filename, err)
Why does it need to be at the end?
forward compatibility?