friendica-exporter/internal/testutil/testutil.go
2024-10-27 19:51:26 +01:00

21 lines
311 B
Go

package testutil
import (
"strings"
)
// EqualErrorMessage compares two errors by just comparing their messages.
func EqualErrorMessage(a, b error) bool {
aMsg := "<nil>"
if a != nil {
aMsg = a.Error()
}
bMsg := "<nil>"
if b != nil {
bMsg = b.Error()
}
return strings.Compare(aMsg, bMsg) == 0
}