]> Cypherpunks repositories - gostls13.git/commitdiff
text/template: removed truncation of context in error message
authorAlexandre Maari <draeron@gmail.com>
Mon, 15 Oct 2018 17:23:09 +0000 (13:23 -0400)
committerRob Pike <r@golang.org>
Tue, 23 Oct 2018 00:28:36 +0000 (00:28 +0000)
Fixes #27930

Change-Id: I31ad3fdb74d74152268c59ae4c651cc4c8c1716d
Reviewed-on: https://go-review.googlesource.com/c/142217
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/text/template/parse/parse.go

index cb9b44e9da003a43f2aefcfde8e28cedfd708efd..efdad3297c686bfc69c99f1978c7cba9043a1933 100644 (file)
@@ -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
 }