samePointers compares two generic interface objects and returns whether they point to the same object
(first, second interface{})
| 531 | // samePointers compares two generic interface objects and returns whether |
| 532 | // they point to the same object |
| 533 | func samePointers(first, second interface{}) bool { |
| 534 | firstPtr, secondPtr := reflect.ValueOf(first), reflect.ValueOf(second) |
| 535 | if firstPtr.Kind() != reflect.Ptr || secondPtr.Kind() != reflect.Ptr { |
| 536 | return false |
| 537 | } |
| 538 | |
| 539 | firstType, secondType := reflect.TypeOf(first), reflect.TypeOf(second) |
| 540 | if firstType != secondType { |
| 541 | return false |
| 542 | } |
| 543 | |
| 544 | // compare pointer addresses |
| 545 | return first == second |
| 546 | } |
| 547 | |
| 548 | // formatUnequalValues takes two values of arbitrary types and returns string |
| 549 | // representations appropriate to be presented to the user. |
no outgoing calls
searching dependent graphs…