I am learning how error comparison works in Go and found something I cannot understand.
Function errors.Is(err, target error) checks if target is Comparable.
func Is(err, target error) bool {
if target == nil {
return err == target
}
isComparable := reflectlite.TypeOf(target).Comparable()
for {
if isComparable && err == target {
return true
}
Which case does this call handle given that all interfaces in Go are comparable and error is an interface?