The README.md file has these lines:
MyObjectDef.SetIs((*MyObject)(nil), (MyInterface)(nil))
// ...
ctn.Get(reflect.TypeOf((MyInterface)(nil))).(MyInterface)
Both methods SetIs and reflect.TypeOf accept interface{}, so you lose MyInterface wrapper and the methods will receive nil wrapped in interface{}. You can't pass any interface value to these methods. The right way to send an interface value to reflect.TypeOf is to send a link to an interface, and then call Elem().
This code from the documentation doesn't work, and I can't find a way to teach the container to build some interface value.
The
README.mdfile has these lines:Both methods
SetIsandreflect.TypeOfacceptinterface{}, so you loseMyInterfacewrapper and the methods will receivenilwrapped ininterface{}. You can't pass any interface value to these methods. The right way to send an interface value toreflect.TypeOfis to send a link to an interface, and then callElem().This code from the documentation doesn't work, and I can't find a way to teach the container to build some interface value.