Is this type exported or a builtin?
(t reflect.Type)
| 44 | |
| 45 | // Is this type exported or a builtin? |
| 46 | func isExportedOrBuiltinType(t reflect.Type) bool { |
| 47 | for t.Kind() == reflect.Ptr { |
| 48 | t = t.Elem() |
| 49 | } |
| 50 | // PkgPath will be non-empty even for an exported type, |
| 51 | // so we need to check the type name as well. |
| 52 | return isExported(t.Name()) || t.PkgPath() == "" |
| 53 | } |
| 54 | |
| 55 | var contextType = reflect.TypeOf((*context.Context)(nil)).Elem() |
| 56 |
no test coverage detected