aboutsummaryrefslogtreecommitdiff
path: root/callback_test.go
diff options
context:
space:
mode:
authorPhil Eaton <phil@eatonphil.com>2022-05-29 21:06:43 -0400
committerGitHub <noreply@github.com>2022-05-29 21:06:43 -0400
commit3ccccfb4c9c683a80e2cce810ac652616579e51c (patch)
treef7c0fa7538e2267a9f3008646ed737678b0f0c1c /callback_test.go
parentAdd error checking in simple example for tx.Commit (diff)
downloadgolite-3ccccfb4c9c683a80e2cce810ac652616579e51c.tar.gz
golite-3ccccfb4c9c683a80e2cce810ac652616579e51c.tar.xz
Support returning any from callbacks (#1046)
Support returning any from callbacks
Diffstat (limited to 'callback_test.go')
-rw-r--r--callback_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/callback_test.go b/callback_test.go
index 714ed60..b09122a 100644
--- a/callback_test.go
+++ b/callback_test.go
@@ -102,3 +102,15 @@ func TestCallbackConverters(t *testing.T) {
}
}
}
+
+func TestCallbackReturnAny(t *testing.T) {
+ udf := func() interface{} {
+ return 1
+ }
+
+ typ := reflect.TypeOf(udf)
+ _, err := callbackRet(typ.Out(0))
+ if err != nil {
+ t.Errorf("Expected valid callback for any return type, got: %s", err)
+ }
+}