(v interface{})
| 1779 | } |
| 1780 | |
| 1781 | func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) { |
| 1782 | t := reflect.TypeOf(v) |
| 1783 | k := t.Kind() |
| 1784 | |
| 1785 | if k == reflect.Ptr { |
| 1786 | t = t.Elem() |
| 1787 | k = t.Kind() |
| 1788 | } |
| 1789 | return t, k |
| 1790 | } |
| 1791 | |
| 1792 | // diff returns a diff of both values as long as both are of the same type and |
| 1793 | // are a struct, map, slice, array or string. Otherwise it returns an empty string. |