summaryrefslogtreecommitdiff
path: root/src/cmd/gofmt/testdata/composites.input
blob: 15afd9e5c4f32cc8d56607369efa52e1344f7160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package P

type T struct {
	x, y int
}

var _ = [42]T{
	T{},
	T{1, 2},
	T{3, 4},
}

var _ = [...]T{
	T{},
	T{1, 2},
	T{3, 4},
}

var _ = []T{
	T{},
	T{1, 2},
	T{3, 4},
}

var _ = []T{
	T{},
	10: T{1, 2},
	20: T{3, 4},
}

var _ = []struct {
	x, y int
}{
	struct{ x, y int }{},
	10: struct{ x, y int }{1, 2},
	20: struct{ x, y int }{3, 4},
}

var _ = []interface{}{
	T{},
	10: T{1, 2},
	20: T{3, 4},
}

var _ = [][]int{
	[]int{},
	[]int{1, 2},
	[]int{3, 4},
}

var _ = [][]int{
	([]int{}),
	([]int{1, 2}),
	[]int{3, 4},
}

var _ = [][][]int{
	[][]int{},
	[][]int{
		[]int{},
		[]int{0, 1, 2, 3},
		[]int{4, 5},
	},
}

var _ = map[string]T{
	"foo": T{},
	"bar": T{1, 2},
	"bal": T{3, 4},
}

var _ = map[string]struct {
	x, y int
}{
	"foo": struct{ x, y int }{},
	"bar": struct{ x, y int }{1, 2},
	"bal": struct{ x, y int }{3, 4},
}

var _ = map[string]interface{}{
	"foo": T{},
	"bar": T{1, 2},
	"bal": T{3, 4},
}

var _ = map[string][]int{
	"foo": []int{},
	"bar": []int{1, 2},
	"bal": []int{3, 4},
}

var _ = map[string][]int{
	"foo": ([]int{}),
	"bar": ([]int{1, 2}),
	"bal": []int{3, 4},
}

// from exp/4s/data.go
var pieces4 = []Piece{
	Piece{0, 0, Point{4, 1}, []Point{Point{0, 0}, Point{1, 0}, Point{1, 0}, Point{1, 0}}, nil, nil},
	Piece{1, 0, Point{1, 4}, []Point{Point{0, 0}, Point{0, 1}, Point{0, 1}, Point{0, 1}}, nil, nil},
	Piece{2, 0, Point{4, 1}, []Point{Point{0, 0}, Point{1, 0}, Point{1, 0}, Point{1, 0}}, nil, nil},
	Piece{3, 0, Point{1, 4}, []Point{Point{0, 0}, Point{0, 1}, Point{0, 1}, Point{0, 1}}, nil, nil},
}