gonum / gonum/plot

plot: streamline error handling in examples

Open
#561 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
3k
Forks
201
PR merge metrics
No merged PRs in 30d

Description

we should streamline and harmonize error handling in examples.
some are using:
```go
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:
```go
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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.