Skip to content

plot: streamline error handling in examples #561

Open
@sbinet

Description

@sbinet

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions