Assuming you read that issue first, and especially https://github.com/smartystreets/goconvey/issues/665#issuecomment-1489390117 , the right fix would be for the diff to report which types are different. That would be a little involved, especially if anyone has managed to rely on the exact output format that is provided currently.
A lazier fix would be something like the below
func ShouldResemble(actual interface{}, expected ...interface{}) string {
if message := need(1, expected); message != success {
return message
}
if matchError := oglematchers.DeepEquals(expected[0]).Matches(actual); matchError != nil {
renderedExpected, renderedActual := render.Render(expected[0]), render.Render(actual)
message := fmt.Sprintf(shouldHaveResembled, renderedExpected, renderedActual)
if renderedExpected != renderedActual {
message += composePrettyDiff(renderedExpected, renderedActual)
} else {
message += "No visual diff, but there is a difference in type within expected versus actual"
}
return serializer.serializeDetailed(expected[0], actual, message)
}
return success
}
This was initially filed as an issue on goconvey: https://github.com/smartystreets/goconvey/issues/665 But really it's a problem in this assertions code.
Assuming you read that issue first, and especially https://github.com/smartystreets/goconvey/issues/665#issuecomment-1489390117 , the right fix would be for the diff to report which types are different. That would be a little involved, especially if anyone has managed to rely on the exact output format that is provided currently. A lazier fix would be something like the below
FYI @riannucci