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

Function ExampleXError_Id

xerror/xerror_example_test.go:80–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78}
79
80func ExampleXError_Id() {
81 err1 := New("error").Id("e001")
82 err2 := New("error").Id("e001")
83 err3 := New("error").Id("e003")
84
85 equal := err1.Is(err2)
86 notEqual := err1.Is(err3)
87
88 fmt.Println(equal)
89 fmt.Println(notEqual)
90
91 // Output:
92 // true
93 // false
94}
95
96func ExampleXError_Is() {
97 err1 := New("error").Id("e001")

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…