diff options
author | mattn <mattn.jp@gmail.com> | 2018-06-08 10:05:37 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 10:05:37 +0900 |
commit | 4218441e44e93e64bc8ed054741a2c33988500b5 (patch) | |
tree | 9677a3a0521b9fe7a59cab240a8177e85589cdd3 /callback.go | |
parent | Merge pull request #583 from lucasmrod/bug/#542-nil-byte-slice-to-null-blob (diff) | |
parent | Fix: test suite remove created files (diff) | |
download | golite-4218441e44e93e64bc8ed054741a2c33988500b5.tar.gz golite-4218441e44e93e64bc8ed054741a2c33988500b5.tar.xz |
Merge pull request #586 from mattn/feature/userauth
Feature/userauth
Diffstat (limited to 'callback.go')
-rw-r--r-- | callback.go | 10 |
1 files changed, 10 insertions, 0 deletions
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") |