Descriptionexp/template: don't panic on range of nil interface
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.
Patch Set 1 #Patch Set 2 : code review 4876046: exp/template: don't panic on range of nil interface #Patch Set 3 : diff -r 160518ccd695 https://go.googlecode.com/hg/ #Patch Set 4 : diff -r 160518ccd695 https://go.googlecode.com/hg/ #
Total comments: 8
Patch Set 5 : diff -r 160518ccd695 https://go.googlecode.com/hg/ #Patch Set 6 : diff -r 160518ccd695 https://go.googlecode.com/hg/ #Patch Set 7 : diff -r af3bbd9ae031 https://go.googlecode.com/hg/ #MessagesTotal messages: 9
|