• Gustavo Niemeyer's avatar
    exp/template: don't panic on range of nil interface · e3f3a541
    Gustavo Niemeyer authored
    This avoids a non-obvious panic when range is used on a
    nil interface, and fixes it by behaving as if the range
    was empty.
    
    The new behavior is equivalent to the outcome of iterating
    on a nil map or slice, and is useful because it allows
    generic structures such as used in json (map[string]interface{})
    to behave correctly if a key generally set to a list or map
    isn't present.
    
    R=golang-dev, r, gustavo
    CC=golang-dev
    https://golang.org/cl/4876046
    e3f3a541
Name
Last commit
Last update
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...