aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/exec_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-10-26 13:12:17 -0400
committerRuss Cox <rsc@golang.org>2016-10-28 17:10:55 +0000
commitef3a9f2dd410ec1672988a72c72919eab2d58e6c (patch)
treeb14da855c04d3f4e975db8bd5b7171b3b94288e4 /src/text/template/exec_test.go
parent54f691d69d39bc19c2069384cd702c6fdec0b92d (diff)
downloadgo-ef3a9f2dd410ec1672988a72c72919eab2d58e6c.tar.xz
html/template, text/template: drop defined template list from errors
The report in #17414 points out that if you have many many templates, then this is an overwhelming list and just hurts the signal-to-noise ratio of the error. Even the test of the old behavior also supports the idea that this is noise: template: empty: "empty" is an incomplete or empty template; defined templates are: "secondary" The chance that someone mistyped "secondary" as "empty" is slim at best. Similarly, the compiler does not augment an error like 'unknown variable x' by dumping the full list of all the known variables. For all these reasons, drop the list. Fixes #17414. Change-Id: I78f92d2c591df7218385fe723a4abc497913acf8 Reviewed-on: https://go-review.googlesource.com/32116 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/text/template/exec_test.go')
-rw-r--r--src/text/template/exec_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/text/template/exec_test.go b/src/text/template/exec_test.go
index 1c7e115554..99b9434b78 100644
--- a/src/text/template/exec_test.go
+++ b/src/text/template/exec_test.go
@@ -932,7 +932,7 @@ func TestMessageForExecuteEmpty(t *testing.T) {
t.Fatal("expected second error")
}
got = err.Error()
- want = `template: empty: "empty" is an incomplete or empty template; defined templates are: "secondary"`
+ want = `template: empty: "empty" is an incomplete or empty template`
if got != want {
t.Errorf("expected error %s got %s", want, got)
}