]> Cypherpunks repositories - gostls13.git/commitdiff
text/template: Document that range can be used on chan types.
authorKamil Kisiel <kamil@kamilkisiel.net>
Sat, 12 Jan 2013 00:06:13 +0000 (11:06 +1100)
committerAndrew Gerrand <adg@golang.org>
Sat, 12 Jan 2013 00:06:13 +0000 (11:06 +1100)
Fixes #4640.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7082044

src/pkg/text/template/doc.go

index 807914c24c87d1c6bd26d92c5b5333638c7c4679..2da339ce8351d9b5a8be237b0b699bbf8a250d5c 100644 (file)
@@ -63,16 +63,16 @@ data, defined in detail below.
                otherwise, T1 is executed.  Dot is unaffected.
 
        {{range pipeline}} T1 {{end}}
-               The value of the pipeline must be an array, slice, or map. If
-               the value of the pipeline has length zero, nothing is output;
+               The value of the pipeline must be an array, slice, map, or channel.
+               If the value of the pipeline has length zero, nothing is output;
                otherwise, dot is set to the successive elements of the array,
                slice, or map and T1 is executed. If the value is a map and the
                keys are of basic type with a defined order ("comparable"), the
                elements will be visited in sorted key order.
 
        {{range pipeline}} T1 {{else}} T0 {{end}}
-               The value of the pipeline must be an array, slice, or map. If
-               the value of the pipeline has length zero, dot is unaffected and
+               The value of the pipeline must be an array, slice, map, or channel.
+               If the value of the pipeline has length zero, dot is unaffected and
                T0 is executed; otherwise, dot is set to the successive elements
                of the array, slice, or map and T1 is executed.