MCPcopy
hub / github.com/duke-git/lancet / ExampleXError_Is

Function ExampleXError_Is

xerror/xerror_example_test.go:96–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94}
95
96func ExampleXError_Is() {
97 err1 := New("error").Id("e001")
98 err2 := New("error").Id("e001")
99 err3 := New("error").Id("e003")
100
101 equal := err1.Is(err2)
102 notEqual := err1.Is(err3)
103
104 fmt.Println(equal)
105 fmt.Println(notEqual)
106
107 // Output:
108 // true
109 // false
110}
111
112func ExampleXError_Values() {
113 err := New("error").With("level", "high")

Callers

nothing calls this directly

Calls 3

IdMethod · 0.80
IsMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…