• Rob Pike's avatar
    text/template: verify that names in FuncMap are valid identifiers · dbfd9085
    Rob Pike authored
    There was no verification in Funcs that the map had valid names,
    which meant that the error could only be caught when parsing
    the template that tried to use them. Fix this by validating the names
    in Funcs and panicking before parsing if there is a bad name.
    
    This is arguably an API change, since it didn't trigger a panic
    before, but Funcs did already panic if the function itself was no
    good, so I argue it's an acceptable change to add more sanity
    checks.
    
    Fixes #9685.
    
    Change-Id: Iabf1d0602c49d830f3ed71ca1ccc7eb9a5521ff5
    Reviewed-on: https://go-review.googlesource.com/14562Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
    dbfd9085
Name
Last commit
Last update
..
scanner Loading commit data...
tabwriter Loading commit data...
template Loading commit data...