-
Notifications
You must be signed in to change notification settings - Fork 1k
gps: use golang.org/x/sync/errgroup #1155
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors.WithMessage
is cheaper in cases like this too, when we don't need the stack trace.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not going to make that optimization; it doesn't matter and will be net-negative the very first time someone looks to find where this error originates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the same logic apply to removing
sourceFailures
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How?
sourceFailures
provides nothing at all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this change the final cause in the chain of errors was a
sourceFailures
with all of its errors preserved, so fiddling with the error at the top level, or with the format verb, could potentially provide some insight.Now it's an
errors.New()
with only the string messages of the original errors, so they'll have to come here to edit this method directly to follow the trail any deeper.An improved version of
sourceFailures
might implementfmt.Formatter
(or be generalized into amultiError{causes, msg}
), but I think it's still offering something as-is.