Function
typeAndKind
assert/assertions.go:1900–1909
· assert/assertions.go::typeAndKind
(v interface{})
Source from the content-addressed store, hash-verified
| 1898 | } |
| 1899 | |
| 1900 | func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) { |
| 1901 | t := reflect.TypeOf(v) |
| 1902 | k := t.Kind() |
| 1903 | |
| 1904 | if k == reflect.Ptr { |
| 1905 | t = t.Elem() |
| 1906 | k = t.Kind() |
| 1907 | } |
| 1908 | return t, k |
| 1909 | } |
| 1910 | |
| 1911 | // diff returns a diff of both values as long as both are of the same type and |
| 1912 | // are a struct, map, slice, array or string. Otherwise it returns an empty string. |
Tested by
no test coverage detected