5 ms·
The go vet command checks format strings. I expect that the command will be updated to check for correct use of %w.
by BarkMore 7y ago
The go vet command checks format strings. I expect that the command will be updated to check for correct use of %w.
- scrollaway 7y agoWhat's the point of making it a format string if you are hardcoding where the % identifier goes anyway?!
- secure 7y agoThe %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)
- int_19h 7y agoWhy does it need to be at the end?
- greenleafjacob 7y agoforward compatibility?