From: Alexandre Maari Date: Mon, 15 Oct 2018 17:23:09 +0000 (-0400) Subject: text/template: removed truncation of context in error message X-Git-Tag: go1.12beta1~691 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0cc4c2971da80d010af5a3336ad2e7fda06f06a8;p=gostls13.git text/template: removed truncation of context in error message Fixes #27930 Change-Id: I31ad3fdb74d74152268c59ae4c651cc4c8c1716d Reviewed-on: https://go-review.googlesource.com/c/142217 Reviewed-by: Rob Pike Run-TryBot: Rob Pike TryBot-Result: Gobot Gobot --- diff --git a/src/text/template/parse/parse.go b/src/text/template/parse/parse.go index cb9b44e9da..efdad3297c 100644 --- a/src/text/template/parse/parse.go +++ b/src/text/template/parse/parse.go @@ -148,9 +148,6 @@ func (t *Tree) ErrorContext(n Node) (location, context string) { } lineNum := 1 + strings.Count(text, "\n") context = n.String() - if len(context) > 20 { - context = fmt.Sprintf("%.20s...", context) - } return fmt.Sprintf("%s:%d:%d", tree.ParseName, lineNum, byteNum), context }