diff options
author | Phil Eaton <phil@eatonphil.com> | 2022-05-29 21:06:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-29 21:06:43 -0400 |
commit | 3ccccfb4c9c683a80e2cce810ac652616579e51c (patch) | |
tree | f7c0fa7538e2267a9f3008646ed737678b0f0c1c /callback_test.go | |
parent | Add error checking in simple example for tx.Commit (diff) | |
download | golite-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.go | 12 |
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) + } +} |