]> Cypherpunks repositories - gostls13.git/commit
text/template: detect unmatched else at parsing time
authorDidier Spezia <didier.06@gmail.com>
Fri, 1 May 2015 18:20:31 +0000 (18:20 +0000)
committerRob Pike <r@golang.org>
Fri, 1 May 2015 21:27:27 +0000 (21:27 +0000)
commit80cedf3e8f912d7d7defd8e0495c6fd67d229555
tree690edaec69371300f2b12adf8f53e3ff556c8e5a
parent8a072ada84d552a5d1511271f36d91f4fb236908
text/template: detect unmatched else at parsing time

An unmatched {{else}} should trigger a parsing error.

The top level parser is able to issue an error in case
of unmatched {{end}}. It does it a posteriori (i.e. after having
parsed the action).

Extend this behavior to also check for unmatched {{else}}

Fixes #10611

Change-Id: I1d4f433cc64e11bea5f4d61419ccc707ac01bb1d
Reviewed-on: https://go-review.googlesource.com/9620
Reviewed-by: Rob Pike <r@golang.org>
src/text/template/parse/parse.go
src/text/template/parse/parse_test.go