From 6ae7f98274c6e254f84a9b8349b4a4eed0bee8a5 Mon Sep 17 00:00:00 2001 From: Gert-Jan Timmer Date: Wed, 30 May 2018 22:36:49 +0200 Subject: ADD: User authentication * User Authentication Implementation * Rename file to conform to fileformat `sqlite3_*_omit.go` * Updated sqlite3-binding.* with new upgrade tool * Add: callbackRetNil required for error type return because of adding `RegisterFunc`s directly on the connection. * Add: TestCreateAuthDatabase --- callback.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'callback.go') diff --git a/callback.go b/callback.go index 29ece3d..5a735c0 100644 --- a/callback.go +++ b/callback.go @@ -331,8 +331,18 @@ func callbackRetText(ctx *C.sqlite3_context, v reflect.Value) error { return nil } +func callbackRetNil(ctx *C.sqlite3_context, v reflect.Value) error { + return nil +} + func callbackRet(typ reflect.Type) (callbackRetConverter, error) { switch typ.Kind() { + case reflect.Interface: + errorInterface := reflect.TypeOf((*error)(nil)).Elem() + if typ.Implements(errorInterface) { + return callbackRetNil, nil + } + fallthrough case reflect.Slice: if typ.Elem().Kind() != reflect.Uint8 { return nil, errors.New("the only supported slice type is []byte") -- cgit v1.2.3