We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
we should streamline and harmonize error handling in examples. some are using:
if err != nil { panic(err) }
while others are using log.Panic(err) and others are using log.Fatal(err).
log.Panic(err)
log.Fatal(err)
I'd err on (consistently) using this kind of error handling:
if err != nil { log.Fatalf("could not do or perform foo: %+v", err) }
(notice the %+v to be compatible with fmt.Errorf of Go-1.13 and golang.org/x/xerrors.Errorf for earlier Go versions)
%+v
fmt.Errorf
golang.org/x/xerrors.Errorf
The text was updated successfully, but these errors were encountered:
No branches or pull requests
we should streamline and harmonize error handling in examples.
some are using:
while others are using
log.Panic(err)
and others are usinglog.Fatal(err)
.I'd err on (consistently) using this kind of error handling:
(notice the
%+v
to be compatible withfmt.Errorf
of Go-1.13 andgolang.org/x/xerrors.Errorf
for earlier Go versions)The text was updated successfully, but these errors were encountered: