MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / ErrorEqual

Function ErrorEqual

IceFireDB-SQLProxy/pkg/mysql/mysql/util.go:374–387  ·  view source on GitHub ↗

ErrorEqual returns a boolean indicating whether err1 is equal to err2.

(err1, err2 error)

Source from the content-addressed store, hash-verified

372
373// ErrorEqual returns a boolean indicating whether err1 is equal to err2.
374func ErrorEqual(err1, err2 error) bool {
375 e1 := errors.Cause(err1)
376 e2 := errors.Cause(err2)
377
378 if e1 == e2 {
379 return true
380 }
381
382 if e1 == nil || e2 == nil {
383 return e1 == e2
384 }
385
386 return e1.Error() == e2.Error()
387}
388
389var encodeRef = map[byte]byte{
390 '\x00': '0',

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected