Open
Description
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)
.
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)
Metadata
Metadata
Assignees
Labels
No labels