diff --git a/callbacks.go b/callbacks.go index 112d35a..7f4637b 100644 --- a/callbacks.go +++ b/callbacks.go @@ -23,10 +23,11 @@ func (b bindings) clone() bindings { return out } -func (b bindings) merge(other bindings) { +func (b bindings) merge(other bindings) bindings { for k, v := range other { b[k] = v } + return b } func getMethod(value reflect.Value, name string) reflect.Value { diff --git a/context.go b/context.go index 201ce16..2b6dbbb 100644 --- a/context.go +++ b/context.go @@ -501,7 +501,7 @@ func (c *Context) Run(bindings ...interface{}) (err error) { if err != nil { return err } - binds := c.Kong.bindings.clone().add(bindings...).add(c) + binds := c.Kong.bindings.clone().add(bindings...).add(c).merge(c.bindings) return callMethod("Run", node.Target, method, binds) }