Debian Codegraph @

internal/testutil/testutil.go

raw symbols SCIP
1 package testutil
2
3 import (
4 "strings"
5 )
6
7 // EqualErrorMessage compares two errors by just comparing their messages.
8 func EqualErrorMessage(a, b error) bool {
9 aMsg := "<nil>"
10 if a != nil {
11 aMsg = a.Error()
12 }
13
14 bMsg := "<nil>"
15 if b != nil {
16 bMsg = b.Error()
17 }
18
19 return strings.Compare(aMsg, bMsg) == 0
20 }