Skip to content

Latest commit

 

History

History
34 lines (20 loc) · 892 Bytes

README.md

File metadata and controls

34 lines (20 loc) · 892 Bytes

onerr

Build Status Code Coverage Documentation

onerr is a very small package that provides functions to quickly handle errors.

Example

f, err := os.Create("output.txt")
onerr.Panic(err)             // Panics if the file cannot be created.
defer onerr.LogFunc(f.Close) // Logs any error while closing the file.

_, err = f.WriteString("output")
// Logs any write error like: error while writing "output.txt": disk is full
onerr.Logf(err, "error while writing %q", f.Name())

Documentation

https://godoc.org/gopkg.in/onerr.v1

Download

go get gopkg.in/onerr.v1

License

MIT