github.com/sbinet/go@v0.0.0-20160827155028-54d7de7dd62b/src/cmd/gofmt/testdata/composites.golden (about) 1 //gofmt -s 2 3 package P 4 5 type T struct { 6 x, y int 7 } 8 9 var _ = [42]T{ 10 {}, 11 {1, 2}, 12 {3, 4}, 13 } 14 15 var _ = [...]T{ 16 {}, 17 {1, 2}, 18 {3, 4}, 19 } 20 21 var _ = []T{ 22 {}, 23 {1, 2}, 24 {3, 4}, 25 } 26 27 var _ = []T{ 28 {}, 29 10: {1, 2}, 30 20: {3, 4}, 31 } 32 33 var _ = []struct { 34 x, y int 35 }{ 36 {}, 37 10: {1, 2}, 38 20: {3, 4}, 39 } 40 41 var _ = []interface{}{ 42 T{}, 43 10: T{1, 2}, 44 20: T{3, 4}, 45 } 46 47 var _ = [][]int{ 48 {}, 49 {1, 2}, 50 {3, 4}, 51 } 52 53 var _ = [][]int{ 54 ([]int{}), 55 ([]int{1, 2}), 56 {3, 4}, 57 } 58 59 var _ = [][][]int{ 60 {}, 61 { 62 {}, 63 {0, 1, 2, 3}, 64 {4, 5}, 65 }, 66 } 67 68 var _ = map[string]T{ 69 "foo": {}, 70 "bar": {1, 2}, 71 "bal": {3, 4}, 72 } 73 74 var _ = map[string]struct { 75 x, y int 76 }{ 77 "foo": {}, 78 "bar": {1, 2}, 79 "bal": {3, 4}, 80 } 81 82 var _ = map[string]interface{}{ 83 "foo": T{}, 84 "bar": T{1, 2}, 85 "bal": T{3, 4}, 86 } 87 88 var _ = map[string][]int{ 89 "foo": {}, 90 "bar": {1, 2}, 91 "bal": {3, 4}, 92 } 93 94 var _ = map[string][]int{ 95 "foo": ([]int{}), 96 "bar": ([]int{1, 2}), 97 "bal": {3, 4}, 98 } 99 100 // from exp/4s/data.go 101 var pieces4 = []Piece{ 102 {0, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, 103 {1, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, 104 {2, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, 105 {3, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, 106 } 107 108 var _ = [42]*T{ 109 {}, 110 {1, 2}, 111 {3, 4}, 112 } 113 114 var _ = [...]*T{ 115 {}, 116 {1, 2}, 117 {3, 4}, 118 } 119 120 var _ = []*T{ 121 {}, 122 {1, 2}, 123 {3, 4}, 124 } 125 126 var _ = []*T{ 127 {}, 128 10: {1, 2}, 129 20: {3, 4}, 130 } 131 132 var _ = []*struct { 133 x, y int 134 }{ 135 {}, 136 10: {1, 2}, 137 20: {3, 4}, 138 } 139 140 var _ = []interface{}{ 141 &T{}, 142 10: &T{1, 2}, 143 20: &T{3, 4}, 144 } 145 146 var _ = []*[]int{ 147 {}, 148 {1, 2}, 149 {3, 4}, 150 } 151 152 var _ = []*[]int{ 153 (&[]int{}), 154 (&[]int{1, 2}), 155 {3, 4}, 156 } 157 158 var _ = []*[]*[]int{ 159 {}, 160 { 161 {}, 162 {0, 1, 2, 3}, 163 {4, 5}, 164 }, 165 } 166 167 var _ = map[string]*T{ 168 "foo": {}, 169 "bar": {1, 2}, 170 "bal": {3, 4}, 171 } 172 173 var _ = map[string]*struct { 174 x, y int 175 }{ 176 "foo": {}, 177 "bar": {1, 2}, 178 "bal": {3, 4}, 179 } 180 181 var _ = map[string]interface{}{ 182 "foo": &T{}, 183 "bar": &T{1, 2}, 184 "bal": &T{3, 4}, 185 } 186 187 var _ = map[string]*[]int{ 188 "foo": {}, 189 "bar": {1, 2}, 190 "bal": {3, 4}, 191 } 192 193 var _ = map[string]*[]int{ 194 "foo": (&[]int{}), 195 "bar": (&[]int{1, 2}), 196 "bal": {3, 4}, 197 } 198 199 var pieces4 = []*Piece{ 200 {0, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, 201 {1, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, 202 {2, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, 203 {3, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, 204 }