* Helper functions */ ObjectsAreEqual determines if two objects are considered equal. This function does no assertion of any kind.
(expected, actual interface{})
| 62 | // |
| 63 | // This function does no assertion of any kind. |
| 64 | func ObjectsAreEqual(expected, actual interface{}) bool { |
| 65 | if expected == nil || actual == nil { |
| 66 | return expected == actual |
| 67 | } |
| 68 | |
| 69 | exp, ok := expected.([]byte) |
| 70 | if !ok { |
| 71 | return reflect.DeepEqual(expected, actual) |
| 72 | } |
| 73 | |
| 74 | act, ok := actual.([]byte) |
| 75 | if !ok { |
| 76 | return false |
| 77 | } |
| 78 | if exp == nil || act == nil { |
| 79 | return exp == nil && act == nil |
| 80 | } |
| 81 | return bytes.Equal(exp, act) |
| 82 | } |
| 83 | |
| 84 | // copyExportedFields iterates downward through nested data structures and creates a copy |
| 85 | // that only contains the exported struct fields. |