~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/text/template/doc.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
                otherwise, T1 is executed.  Dot is unaffected.
64
64
 
65
65
        {{range pipeline}} T1 {{end}}
66
 
                The value of the pipeline must be an array, slice, or map. If
67
 
                the value of the pipeline has length zero, nothing is output;
 
66
                The value of the pipeline must be an array, slice, map, or channel.
 
67
                If the value of the pipeline has length zero, nothing is output;
68
68
                otherwise, dot is set to the successive elements of the array,
69
69
                slice, or map and T1 is executed. If the value is a map and the
70
70
                keys are of basic type with a defined order ("comparable"), the
71
71
                elements will be visited in sorted key order.
72
72
 
73
73
        {{range pipeline}} T1 {{else}} T0 {{end}}
74
 
                The value of the pipeline must be an array, slice, or map. If
75
 
                the value of the pipeline has length zero, dot is unaffected and
 
74
                The value of the pipeline must be an array, slice, map, or channel.
 
75
                If the value of the pipeline has length zero, dot is unaffected and
76
76
                T0 is executed; otherwise, dot is set to the successive elements
77
77
                of the array, slice, or map and T1 is executed.
78
78
 
100
100
        - A boolean, string, character, integer, floating-point, imaginary
101
101
          or complex constant in Go syntax. These behave like Go's untyped
102
102
          constants, although raw strings may not span newlines.
 
103
        - The keyword nil, representing an untyped Go nil.
103
104
        - The character '.' (period):
104
105
                .
105
106
          The result is the value of dot.
147
148
          The result is the value of invoking the function, fun(). The return
148
149
          types and values behave as in methods. Functions and function
149
150
          names are described below.
 
151
        - A parenthesized instance of one the above, for grouping. The result
 
152
          may be accessed by a field or map key invocation.
 
153
                print (.F1 arg1) (.F2 arg2)
 
154
                (.StructValuedMethod "arg").Field
150
155
 
151
156
Arguments may evaluate to any type; if they are pointers the implementation
152
157
automatically indirects to the base type when required.
198
203
successive elements of the iteration.  Also, a "range" may declare two
199
204
variables, separated by a comma:
200
205
 
201
 
        $index, $element := pipeline
 
206
        range $index, $element := pipeline
202
207
 
203
208
in which case $index and $element are set to the successive values of the
204
209
array/slice index or map key and element, respectively.  Note that if there is
227
232
        {{"output" | printf "%q"}}
228
233
                A function call whose final argument comes from the previous
229
234
                command.
 
235
        {{printf "%q" (print "out" "put")}}
 
236
                A parenthesized argument.
230
237
        {{"put" | printf "%s%s" "out" | printf "%q"}}
231
238
                A more elaborate call.
232
239
        {{"output" | printf "%s" | printf "%q"}}