mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-09 23:22:28 +08:00
feat: add XError to support more contextual error handling
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func ExampleUnwrap() {
|
||||
result1 := Unwrap(strconv.Atoi("42"))
|
||||
func ExampleTryUnwrap() {
|
||||
result1 := TryUnwrap(strconv.Atoi("42"))
|
||||
fmt.Println(result1)
|
||||
|
||||
_, err := strconv.Atoi("4o2")
|
||||
@@ -17,7 +17,7 @@ func ExampleUnwrap() {
|
||||
fmt.Println(result2)
|
||||
}()
|
||||
|
||||
Unwrap(strconv.Atoi("4o2"))
|
||||
TryUnwrap(strconv.Atoi("4o2"))
|
||||
|
||||
// Output:
|
||||
// 42
|
||||
|
||||
Reference in New Issue
Block a user