friendica-exporter/internal/testutil/testutil.go

21 lines
311 B
Go
Raw Permalink Normal View History

2024-10-24 20:26:41 +02:00
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
}