Skip to content

Commit

Permalink
Merge pull request stretchr#211 from jaguilar/patch-1
Browse files Browse the repository at this point in the history
Remove unnecessary branches.
  • Loading branch information
ernesto-jimenez committed Nov 1, 2015
2 parents a0534ac + 1cb1359 commit 9a4de4d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ func ObjectsAreEqual(expected, actual interface{}) bool {
return expected == actual
}

if reflect.DeepEqual(expected, actual) {
return true
}

return false
return reflect.DeepEqual(expected, actual)

}

Expand All @@ -55,9 +51,7 @@ func ObjectsAreEqualValues(expected, actual interface{}) bool {
expectedValue := reflect.ValueOf(expected)
if expectedValue.Type().ConvertibleTo(actualType) {
// Attempt comparison after type conversion
if reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), actual) {
return true
}
return reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), actual)
}

return false
Expand Down

0 comments on commit 9a4de4d

Please sign in to comment.