mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-09 15:12:26 +08:00
doc: add go playground demo for xerror package
This commit is contained in:
@@ -133,7 +133,7 @@ func main() {
|
||||
err1 := xerror.New("error").With("level", "high")
|
||||
wrapErr := errors.Wrap(err1, "oops")
|
||||
|
||||
err := xerror.Unwrap(err1)
|
||||
err := xerror.Unwrap(wrapErr)
|
||||
|
||||
values := err.Values()
|
||||
fmt.Println(values["level"])
|
||||
@@ -441,7 +441,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
err := New("error")
|
||||
err := xerror.New("error")
|
||||
fmt.Println(err.Error())
|
||||
|
||||
// Output:
|
||||
|
||||
@@ -133,7 +133,7 @@ func main() {
|
||||
err1 := xerror.New("error").With("level", "high")
|
||||
wrapErr := errors.Wrap(err1, "oops")
|
||||
|
||||
err := xerror.Unwrap(err1)
|
||||
err := xerror.Unwrap(wrapErr)
|
||||
|
||||
values := err.Values()
|
||||
fmt.Println(values["level"])
|
||||
@@ -441,7 +441,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
err := New("error")
|
||||
err := xerror.New("error")
|
||||
fmt.Println(err.Error())
|
||||
|
||||
// Output:
|
||||
|
||||
Reference in New Issue
Block a user