]> Cypherpunks repositories - gostls13.git/commit
text/template: exec should accept interface value as valid.
authorUgorji Nwoke <ugorji@gmail.com>
Tue, 22 May 2012 22:21:35 +0000 (15:21 -0700)
committerRob Pike <r@golang.org>
Tue, 22 May 2012 22:21:35 +0000 (15:21 -0700)
commit4f7c33cd5ad9181068be0ed0514f9fc9fc36c6ec
treefeab4361eb6f87f8aa5b57314facacf60f2592ee
parent576d648b2a961a474acd6b2236ae062b901bb404
text/template: exec should accept interface value as valid.

Currently, if you pass some data to a template as an interface (e.g. interface{})
and extract that value that value as a parameter for a function, it fails, saying
wrong type.

This is because it is only looking at the interface type, not the interface content.

This CL uses the underlying content as the parameter to the func.

Fixes #3642.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/6218052
src/pkg/text/template/exec.go
src/pkg/text/template/exec_test.go