package
module
Version:
v0.2.1
Opens a new window with list of versions in this module.
Published: Jun 6, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 22
Opens a new window with list of known importers.
README
¶
Introduction
The Repo API is from https://github.com/lainio/err2/tree/v0.9.1#error-checks
I like err2 old api, so I create this.
API
package main
import (
"fmt"
"github.com/shynome/err0"
"github.com/shynome/err0/try"
)
func main() {
var err error
defer err0.Then(&err, func() {
fmt.Println("no error", err)
}, func() {
fmt.Println("has error", err)
})
try.To(fmt.Errorf("hi, error!"))
}
Documentation
¶
func Then(err *error, onok func(), onerr func())
Then only handle try.ToX panic generate error(try.Error)
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.