LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package a | 5 package a |
6 | 6 |
7 type T struct{ A, B int } | 7 type T struct{ A, B int } |
8 | 8 |
9 type A []int | 9 type A []int |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 return 0 | 53 return 0 |
54 } | 54 } |
55 | 55 |
56 func F7() int { | 56 func F7() int { |
57 for m := (M{}); len(m) < (T{1, 2}).A; m[1] = (A{1})[0] { | 57 for m := (M{}); len(m) < (T{1, 2}).A; m[1] = (A{1})[0] { |
58 return 1 | 58 return 1 |
59 } | 59 } |
60 return 0 | 60 return 0 |
61 } | 61 } |
| 62 |
| 63 func F8() int { |
| 64 if a := (&T{1, 1}); a != nil { |
| 65 return 1 |
| 66 } |
| 67 return 0 |
| 68 } |
| 69 |
| 70 func F9() int { |
| 71 var a *T |
| 72 if a = (&T{1, 1}); a != nil { |
| 73 return 1 |
| 74 } |
| 75 return 0 |
| 76 } |
LEFT | RIGHT |