~ubuntu-branches/ubuntu/utopic/golang/utopic

« back to all changes in this revision

Viewing changes to src/pkg/go/printer/testdata/statements.golden

  • 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:
241
241
        }
242
242
}
243
243
 
244
 
// Formatting of for-statement headers.
245
 
func _() {
246
 
        for {
247
 
        }
248
 
        for expr {
249
 
        }
250
 
        for expr {
251
 
        }       // no parens printed
252
 
        for {
253
 
        }       // no semicolons printed
254
 
        for x := expr; ; {
255
 
                use(x)
256
 
        }
257
 
        for expr {
258
 
        }       // no semicolons printed
259
 
        for expr {
260
 
        }       // no semicolons and parens printed
261
 
        for ; ; expr = false {
262
 
        }
263
 
        for x := expr; expr; {
264
 
                use(x)
265
 
        }
266
 
        for x := expr; ; expr = false {
267
 
                use(x)
268
 
        }
269
 
        for ; expr; expr = false {
270
 
        }
271
 
        for x := expr; expr; expr = false {
272
 
                use(x)
273
 
        }
274
 
        for x := range []int{} {
275
 
                use(x)
276
 
        }
277
 
        for x := range []int{} {
278
 
                use(x)
279
 
        }       // no parens printed
 
244
// Formatting of for-statement headers for single-line for-loops.
 
245
func _() {
 
246
        for {
 
247
        }
 
248
        for expr {
 
249
        }
 
250
        for expr {
 
251
        }       // no parens printed
 
252
        for {
 
253
        }       // no semicolons printed
 
254
        for x := expr; ; {
 
255
                use(x)
 
256
        }
 
257
        for expr {
 
258
        }       // no semicolons printed
 
259
        for expr {
 
260
        }       // no semicolons and parens printed
 
261
        for ; ; expr = false {
 
262
        }
 
263
        for x := expr; expr; {
 
264
                use(x)
 
265
        }
 
266
        for x := expr; ; expr = false {
 
267
                use(x)
 
268
        }
 
269
        for ; expr; expr = false {
 
270
        }
 
271
        for x := expr; expr; expr = false {
 
272
                use(x)
 
273
        }
 
274
        for x := range []int{} {
 
275
                use(x)
 
276
        }
 
277
        for x := range []int{} {
 
278
                use(x)
 
279
        }       // no parens printed
 
280
}
 
281
 
 
282
// Formatting of for-statement headers for multi-line for-loops.
 
283
func _() {
 
284
        for {
 
285
        }
 
286
        for expr {
 
287
        }
 
288
        for expr {
 
289
        }       // no parens printed
 
290
        for {
 
291
        }       // no semicolons printed
 
292
        for x := expr; ; {
 
293
                use(x)
 
294
        }
 
295
        for expr {
 
296
        }       // no semicolons printed
 
297
        for expr {
 
298
        }       // no semicolons and parens printed
 
299
        for ; ; expr = false {
 
300
        }
 
301
        for x := expr; expr; {
 
302
                use(x)
 
303
        }
 
304
        for x := expr; ; expr = false {
 
305
                use(x)
 
306
        }
 
307
        for ; expr; expr = false {
 
308
        }
 
309
        for x := expr; expr; expr = false {
 
310
                use(x)
 
311
        }
 
312
        for x := range []int{} {
 
313
                use(x)
 
314
        }
 
315
        for x := range []int{} {
 
316
                use(x)
 
317
        }       // no parens printed
 
318
}
 
319
 
 
320
// Formatting of selected short single- and multi-line statements.
 
321
func _() {
 
322
        if cond {
 
323
        }
 
324
        if cond {
 
325
        }       // multiple lines
 
326
        if cond {
 
327
        } else {
 
328
        }       // else clause always requires multiple lines
 
329
 
 
330
        for {
 
331
        }
 
332
        for i := 0; i < len(a); 1++ {
 
333
        }
 
334
        for i := 0; i < len(a); 1++ {
 
335
                a[i] = i
 
336
        }
 
337
        for i := 0; i < len(a); 1++ {
 
338
                a[i] = i
 
339
        }       // multiple lines
 
340
 
 
341
        for i := range a {
 
342
        }
 
343
        for i := range a {
 
344
                a[i] = i
 
345
        }
 
346
        for i := range a {
 
347
                a[i] = i
 
348
        }       // multiple lines
 
349
 
 
350
        go func() {
 
351
                for {
 
352
                        a <- <-b
 
353
                }
 
354
        }()
 
355
        defer func() {
 
356
                if x := recover(); x != nil {
 
357
                        err = fmt.Sprintf("error: %s", x.msg)
 
358
                }
 
359
        }()
280
360
}
281
361
 
282
362
// Don't remove mandatory parentheses around composite literals in control clauses.
527
607
        // There should be a single empty line before this comment.
528
608
        MoreCode()
529
609
}
 
610
 
 
611
// Formatting of empty statements.
 
612
func _() {
 
613
 
 
614
}
 
615
 
 
616
func _() {
 
617
}
 
618
 
 
619
func _() {
 
620
}
 
621
 
 
622
func _() {
 
623
        f()
 
624
}
 
625
 
 
626
func _() {
 
627
L:
 
628
        ;
 
629
}
 
630
 
 
631
func _() {
 
632
L:
 
633
        ;
 
634
        f()
 
635
}