go/src/text/template
Özgür Kesim 277bcbbdcd text/template: handle option missingkey=error consistently
The existing implementation of text/template handles the option
"missingkey=error" in an inconsitent manner:  If the provided data is
a nil-interface, no error is returned (despite the fact that no key
can be found in it).

This patch makes text/template return an error if "missingkey=error"
is set and the provided data is a not a valid reflect.Value.

Fixes #15356

Change-Id: Ia0a83da48652ecfaf31f18bdbd78cb21dbca1164
Reviewed-on: https://go-review.googlesource.com/31638
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-18 15:56:02 +00:00
..
parse text/template: efficient reporting of line numbers 2016-11-15 00:42:33 +00:00
testdata
doc.go text/template: clarify the default formatting used for values 2016-06-21 02:15:44 +00:00
example_test.go
examplefiles_test.go
examplefunc_test.go
exec.go text/template: handle option missingkey=error consistently 2016-11-18 15:56:02 +00:00
exec_test.go text/template: handle option missingkey=error consistently 2016-11-18 15:56:02 +00:00
funcs.go text/template: reintroduce implicit indirect of interface values in builtin funcs 2016-11-11 19:46:17 +00:00
helper.go html/template, text/template: clarify Parse{Files,Glob} semantics 2016-04-22 02:01:54 +00:00
multi_test.go text/template: fix Parse when called twice with empty text 2016-08-16 23:49:42 +00:00
option.go
template.go html/template, text/template: docs and fixes for template redefinition 2016-10-24 15:43:24 +00:00