]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1] text/template: exec should accept interface value as valid.
authorUgorji Nwoke <ugorji@gmail.com>
Wed, 13 Jun 2012 20:24:09 +0000 (16:24 -0400)
committerRob Pike <r@golang.org>
Wed, 13 Jun 2012 20:24:09 +0000 (16:24 -0400)
commitcee42ca53b1ceb9035bd7cc87ed772ff7e7eeda1
tree5c11008e1308925322e587a5a74feb677bb36cfc
parentadb732b5fd9ee403a295097d0667d20801b146cd
[release-branch.go1] text/template: exec should accept interface value as valid.

««« backport 4c05c319570b
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