Skip to content
New issue

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

plot: streamline error handling in examples #561

Open
sbinet opened this issue Oct 4, 2019 · 0 comments
Open

plot: streamline error handling in examples #561

sbinet opened this issue Oct 4, 2019 · 0 comments

Comments

@sbinet
Copy link
Member

sbinet commented Oct 4, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant