File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -353,13 +353,27 @@ func callbackRetNil(ctx *C.sqlite3_context, v reflect.Value) error {
353353 return nil
354354}
355355
356+ func callbackRetAny (ctx * C.sqlite3_context , v reflect.Value ) error {
357+ cb , err := callbackRet (v .Elem ().Type ())
358+ if err != nil {
359+ return err
360+ }
361+
362+ return cb (ctx , v .Elem ())
363+ }
364+
356365func callbackRet (typ reflect.Type ) (callbackRetConverter , error ) {
357366 switch typ .Kind () {
358367 case reflect .Interface :
359368 errorInterface := reflect .TypeOf ((* error )(nil )).Elem ()
360369 if typ .Implements (errorInterface ) {
361370 return callbackRetNil , nil
362371 }
372+
373+ if typ .NumMethods () == 0 {
374+ return callbackRetAny , nil
375+ }
376+
363377 fallthrough
364378 case reflect .Slice :
365379 if typ .Elem ().Kind () != reflect .Uint8 {
You can’t perform that action at this time.
0 commit comments