mirror of
https://github.com/golang/go
synced 2024-09-28 17:24:28 -06:00
Simplify unwrapping reflect.Interface value in text/template
This commit is contained in:
parent
0a6f05e30f
commit
bdfc6973ab
@ -479,7 +479,7 @@ func (s *state) evalPipeline(dot reflect.Value, pipe *parse.PipeNode) (value ref
|
||||
value = s.evalCommand(dot, cmd, value) // previous value is this one's final arg.
|
||||
// If the object has type interface{}, dig down one level to the thing inside.
|
||||
if value.Kind() == reflect.Interface && value.Type().NumMethod() == 0 {
|
||||
value = reflect.ValueOf(value.Interface()) // lovely!
|
||||
value = value.Elem()
|
||||
}
|
||||
}
|
||||
for _, variable := range pipe.Decl {
|
||||
|
Loading…
Reference in New Issue
Block a user