Y
Hacker News
new
|
ask
|
show
|
jobs
by
BarkMore
2606 days ago
The go vet command checks format strings. I expect that the command will be updated to check for correct use of %w.
1 comments
scrollaway
2606 days ago
What's the point of making it a format string if you are hardcoding where the % identifier goes anyway?!
link
secure
2606 days ago
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)
link
int_19h
2606 days ago
Why does it need to be at the end?
link
greenleafjacob
2606 days ago
forward compatibility?
link