1
0
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:
dudaodong
2023-02-16 14:28:50 +08:00
parent ca9ecb9c8a
commit 572e53aa14
4 changed files with 30 additions and 6 deletions

View File

@@ -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:

View File

@@ -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: