Skip to content

Commit 24c22e3

Browse files
committed
Added M() to example docs
1 parent 09b8995 commit 24c22e3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

example_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ func ExampleE() {
1313
// Output: this is an error
1414
}
1515

16+
func ExampleM() {
17+
err1 := errors.E("this is an error", errors.WithMeta("key1", "val1"))
18+
err2 := errors.M(err1, errors.WithMeta("key2", "val2"))
19+
20+
fmt.Printf("%+v", errors.PrettyPrint(err2))
21+
}
22+
1623
func ExampleE_meta() {
1724

1825
// err will carry a Meta map.

0 commit comments

Comments
 (0)