Skip to content

zyguan/just

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Just a toolkit for error handling in golang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages