18 func IFaceToEFace(ptr unsafe.Pointer) interface{} {
19 iface := (*iface)(ptr)
20 if iface.itab == nil {
23 return packEFace(iface.itab.rtype, iface.data)
26 type UnsafeIFaceType struct {
30 func newUnsafeIFaceType(cfg *frozenConfig, type1 reflect.Type) *UnsafeIFaceType {
31 return &UnsafeIFaceType{
32 unsafeType: *newUnsafeType(cfg, type1),
36 func (type2 *UnsafeIFaceType) Indirect(obj interface{}) interface{} {
37 objEFace := unpackEFace(obj)
38 assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
39 return type2.UnsafeIndirect(objEFace.data)
42 func (type2 *UnsafeIFaceType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
43 return IFaceToEFace(ptr)
46 func (type2 *UnsafeIFaceType) IsNil(obj interface{}) bool {
50 objEFace := unpackEFace(obj)
51 assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
52 return type2.UnsafeIsNil(objEFace.data)
55 func (type2 *UnsafeIFaceType) UnsafeIsNil(ptr unsafe.Pointer) bool {
59 iface := (*iface)(ptr)
60 if iface.itab == nil {