aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/text/template/parse/lex.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/text/template/parse/lex.go')
-rw-r--r--src/pkg/text/template/parse/lex.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/text/template/parse/lex.go b/src/pkg/text/template/parse/lex.go
index 1674aaf9cd..690497d645 100644
--- a/src/pkg/text/template/parse/lex.go
+++ b/src/pkg/text/template/parse/lex.go
@@ -217,6 +217,10 @@ func lexText(l *lexer) stateFn {
}
return lexLeftDelim
}
+ // Check for right after left in case they're the same.
+ if strings.HasPrefix(l.input[l.pos:], l.rightDelim) {
+ return l.errorf("unmatched right delimiter")
+ }
if l.next() == eof {
break
}