-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Closed
Copy link
Labels
FrozenDueToAgeLanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageProposalProposal-FinalCommentPerioderror-handlingLanguage & library change proposals that are about error handling.Language & library change proposals that are about error handling.v2An incompatible library changeAn incompatible library change
Milestone

Description
This approach has probably been discussed in the past. I like to make this a quick feedback.
Existing code:
bg, err := task.NewBackground()
If err != null {
…
}
If I could instantly identify different type of errors handling in a quick reading, it could be written with errors.###
that are implements to receive strings, custom types, etc:
Radom ideas when return errors from .NewBackground()
is not null:
bg, errors.Return := task.NewBackground()
bg, errors.Fatal := task.NewBackground()
bg, errors.Console := task.NewBackground()
bg, errors.Info := task.NewBackground()
bg, errors.Log := task.NewBackground()
bg, errors.CustomSentAlert := task.NewBackground()
Go runtime will handles according to each API.
Does this make sense for handling common errors? I could be wrong as to how these approach works or could be done on package.
OneOfOne, salif, cristaloleg, Matt-Holiday-CardinalPeak, mdlayher and 2 moreDeedleFakexhit
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeLanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageProposalProposal-FinalCommentPerioderror-handlingLanguage & library change proposals that are about error handling.Language & library change proposals that are about error handling.v2An incompatible library changeAn incompatible library change