Avoid aliasing *Output when possible
This commit is contained in:
parent
48ddf5b3b0
commit
f1aec12df2
|
@ -157,10 +157,9 @@ func marshalInput(v interface{}) (interface{}, []Resource, error) {
|
|||
return obj, deps, nil
|
||||
case reflect.Ptr:
|
||||
// See if this is an alias for *Output. If so, convert to an *Output, and recurse.
|
||||
e := rv.Elem()
|
||||
ot := reflect.TypeOf(Output{})
|
||||
if e.Type().ConvertibleTo(ot) {
|
||||
oo := e.Convert(ot)
|
||||
ot := reflect.TypeOf(&Output{})
|
||||
if rv.Type().ConvertibleTo(ot) {
|
||||
oo := rv.Convert(ot)
|
||||
return marshalInput(oo.Interface())
|
||||
}
|
||||
|
||||
|
@ -168,7 +167,7 @@ func marshalInput(v interface{}) (interface{}, []Resource, error) {
|
|||
if rv.IsNil() {
|
||||
return nil, nil, nil
|
||||
}
|
||||
return marshalInput(e.Interface())
|
||||
return marshalInput(rv.Elem().Interface())
|
||||
case reflect.String:
|
||||
return marshalInput(rv.String())
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ func RunErr(body RunFunc) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
contract.Assertf(ctx.stackR != "", "expected root stack resource to have a non-empty URN")
|
||||
|
||||
// Execute the body.
|
||||
var result error
|
||||
|
|
Loading…
Reference in a new issue