• Didier Spezia's avatar
    text/template: check for literals in chain of terms · 76ace947
    Didier Spezia authored
    The current parser ignores obvious errors such as:
    {{0.1.E}}
    {{true.any}}
    {{"hello".wrong}}
    {{nil.E}}
    
    The common problem is that a chain is built from
    a literal value. It then panics at execution time.
    
    Furthermore, a double dot triggers the same behavior:
    {{..E}}
    
    Addresses a TODO left in Tree.operand to catch these
    errors at parsing time.
    
    Note that identifiers can include a '.', and pipelines
    could return an object which a field can be derived
    from (like a variable), so they are excluded from the check.
    
    Fixes #10615
    
    Change-Id: I903706d1c17861b5a8354632c291e73c9c0bc4e1
    Reviewed-on: https://go-review.googlesource.com/9621Reviewed-by: 's avatarRob Pike <r@golang.org>
    76ace947
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...