feat: Embed() option and Context.Call()
The former allows arbitrary structs to be embedded in the root of the CLI, with optional tags. The latter allows an arbitrary function to be called using Kong's binding functionality.
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ func TestInvalidCallback(t *testing.T) {
|
||||
p, err := New(&cli, BindTo(impl("foo"), (*iface)(nil)))
|
||||
assert.NoError(t, err)
|
||||
err = callMethod("method", reflect.ValueOf(impl("??")), reflect.ValueOf(method), p.bindings)
|
||||
assert.EqualError(t, err, `return value of *reflect.rtype.method() must implement "error"`)
|
||||
assert.EqualError(t, err, `kong.impl.method(): return value of func(kong.iface) string must implement "error"`)
|
||||
}
|
||||
|
||||
type zrror struct{}
|
||||
|
||||
Reference in New Issue
Block a user