- Notifications
You must be signed in to change notification settings - Fork927
Open
Labels
Description
Go 1.20 will include two new functions in theerrors
package,Join
andSplit
.
Two problems:
- We use
xerrors
which most likelywill not be updated to support these new functions- The package is not only missing the new functions, it also has it's own implementations of
Is
andAs
which won't support the new functionality
- The package is not only missing the new functions, it also has it's own implementations of
- Typing
xerrors
is unnatural for a Go developer and we often end up with a mix oferrors
andxerrors
We usexerrors
only because they include stack traces.
Proposal: We create our own in-projecterrors
package (github.com/coder/coder/errors
) where we wrap most of thestdlib
errors
functions except those where we want to extend the error with stack traces.
Ways to accomplish this:
- Fork
xerrors
and rename togithub.com/coder/errors
(outside project), bring in line with stdlib - Write our own stack handling, based on
xerrors
,pkg/errors
or similar previous work.