text/template: access to methods that are not part of interface #35198
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I executed a
text/template.Template
with an interface as data.Example code
On play: https://play.golang.org/p/YgMyBPie8kw
What did you expect to see?
My template is using functions that don't exist in the interface, thus I was expecting an error.
What did you see instead?
The template is able to execute functions on the underlying type, exposing functionality I don't want to expose.
I believe the
text/template
package actually behaved as I would expect in the past. I think the functionality was changed in 167a712.The text was updated successfully, but these errors were encountered: