Skip to content

Use fmt for errors, like slog.TextHandler#11

Draft
ansel1 wants to merge 2 commits intophsym:mainfrom
ansel1:formaterrors
Draft

Use fmt for errors, like slog.TextHandler#11
ansel1 wants to merge 2 commits intophsym:mainfrom
ansel1:formaterrors

Conversation

@ansel1
Copy link

@ansel1 ansel1 commented Jan 8, 2025

Uses fmt.Fprintf with "%+v" to print errors. Useful with some error packages which render additional information like stacktraces. Addresses #7

ansel1 and others added 2 commits January 7, 2025 21:16
Uses fmt.Fprintf with "%+v" to print errors.  Useful with some error packages which render additional information like stacktraces.  Addresses phsym#7
If the error doesn't implement fmt.Formatter, as most won't, its faster to use err.Error() than always use fmt to print the error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments