You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:
Run "go version" and compare against
http://golang.org/doc/devel/release.html If a newer version of Go exists,
install it and retry what you did to reproduce the problem.
Thanks.
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1.
2.
3.
Pass a valid value into the template as an interface{} (or other interface value).
Try to use it as a parameter to a function later.
It fails because validateType doesn't account for interface values
(it only accounts for dereferencing pointers).
See: http://play.golang.org/p/Hzf2xal82F
What is the expected output?
From MyLog: Some Message
What do you see instead?
Err: template: t1:1: wrong type for value; expected string; got interface {}
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
Linux
Which version are you using? (run 'go version')
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
…e 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
»»»
The text was updated successfully, but these errors were encountered: