// New creates a new context and initializes the module/library for use. func New(module string) *Ctx { c := new(Ctx) mod := C.CString(module) defer C.free(unsafe.Pointer(mod)) c.ctx = C.New(mod) if c.ctx == nil { return nil } return c }
// New creates a new context and initializes the module/library for use. func New(module string) *Ctx { // libtool-ltdl will return an assertion error if passed an empty string, so // we check for it explicitly. if module == "" { return nil } c := new(Ctx) mod := C.CString(module) defer C.free(unsafe.Pointer(mod)) c.ctx = C.New(mod) if c.ctx == nil { return nil } return c }