Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 489 Bytes

README.md

File metadata and controls

25 lines (20 loc) · 489 Bytes

Just a toolkit for error handling

Build Status

Getting tired of keep writing following boilerplate code?

a, err := f(...)
if err != nil {
    return nil, err
}
b, err := g(...)
if err != nil {
    return nil, err
}

Just try:

defer just.Return(&err)
a := just.Try(f(...)).(A)
b := just.Try(g(...)).(B)

See print-json-files for a complete example.