Ensure context bindings are used for Run().
This commit is contained in:
+2
-1
@@ -23,10 +23,11 @@ func (b bindings) clone() bindings {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b bindings) merge(other bindings) {
|
func (b bindings) merge(other bindings) bindings {
|
||||||
for k, v := range other {
|
for k, v := range other {
|
||||||
b[k] = v
|
b[k] = v
|
||||||
}
|
}
|
||||||
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
func getMethod(value reflect.Value, name string) reflect.Value {
|
func getMethod(value reflect.Value, name string) reflect.Value {
|
||||||
|
|||||||
+1
-1
@@ -501,7 +501,7 @@ func (c *Context) Run(bindings ...interface{}) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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)
|
return callMethod("Run", node.Target, method, binds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user