-
Notifications
You must be signed in to change notification settings - Fork 0
/
tuples_example_test.go
197 lines (164 loc) · 6.51 KB
/
tuples_example_test.go
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
package lo
import (
"fmt"
)
func ExampleT2() {
result := T2("hello", 2)
fmt.Printf("%v %v", result.A, result.B)
// Output: hello 2
}
func ExampleT3() {
result := T3("hello", 2, true)
fmt.Printf("%v %v %v", result.A, result.B, result.C)
// Output: hello 2 true
}
func ExampleT4() {
result := T4("hello", 2, true, foo{bar: "bar"})
fmt.Printf("%v %v %v %v", result.A, result.B, result.C, result.D)
// Output: hello 2 true {bar}
}
func ExampleT5() {
result := T5("hello", 2, true, foo{bar: "bar"}, 4.2)
fmt.Printf("%v %v %v %v %v", result.A, result.B, result.C, result.D, result.E)
// Output: hello 2 true {bar} 4.2
}
func ExampleT6() {
result := T6("hello", 2, true, foo{bar: "bar"}, 4.2, "plop")
fmt.Printf("%v %v %v %v %v %v", result.A, result.B, result.C, result.D, result.E, result.F)
// Output: hello 2 true {bar} 4.2 plop
}
func ExampleT7() {
result := T7("hello", 2, true, foo{bar: "bar"}, 4.2, "plop", false)
fmt.Printf("%v %v %v %v %v %v %v", result.A, result.B, result.C, result.D, result.E, result.F, result.G)
// Output: hello 2 true {bar} 4.2 plop false
}
func ExampleT8() {
result := T8("hello", 2, true, foo{bar: "bar"}, 4.2, "plop", false, 42)
fmt.Printf("%v %v %v %v %v %v %v %v", result.A, result.B, result.C, result.D, result.E, result.F, result.G, result.H)
// Output: hello 2 true {bar} 4.2 plop false 42
}
func ExampleT9() {
result := T9("hello", 2, true, foo{bar: "bar"}, 4.2, "plop", false, 42, "hello world")
fmt.Printf("%v %v %v %v %v %v %v %v %v", result.A, result.B, result.C, result.D, result.E, result.F, result.G, result.H, result.I)
// Output: hello 2 true {bar} 4.2 plop false 42 hello world
}
func ExampleUnpack2() {
a, b := Unpack2(T2("hello", 2))
fmt.Printf("%v %v", a, b)
// Output: hello 2
}
func ExampleUnpack3() {
a, b, c := Unpack3(T3("hello", 2, true))
fmt.Printf("%v %v %v", a, b, c)
// Output: hello 2 true
}
func ExampleUnpack4() {
a, b, c, d := Unpack4(T4("hello", 2, true, foo{bar: "bar"}))
fmt.Printf("%v %v %v %v", a, b, c, d)
// Output: hello 2 true {bar}
}
func ExampleUnpack5() {
a, b, c, d, e := Unpack5(T5("hello", 2, true, foo{bar: "bar"}, 4.2))
fmt.Printf("%v %v %v %v %v", a, b, c, d, e)
// Output: hello 2 true {bar} 4.2
}
func ExampleUnpack6() {
a, b, c, d, e, f := Unpack6(T6("hello", 2, true, foo{bar: "bar"}, 4.2, "plop"))
fmt.Printf("%v %v %v %v %v %v", a, b, c, d, e, f)
// Output: hello 2 true {bar} 4.2 plop
}
func ExampleUnpack7() {
a, b, c, d, e, f, g := Unpack7(T7("hello", 2, true, foo{bar: "bar"}, 4.2, "plop", false))
fmt.Printf("%v %v %v %v %v %v %v", a, b, c, d, e, f, g)
// Output: hello 2 true {bar} 4.2 plop false
}
func ExampleUnpack8() {
a, b, c, d, e, f, g, h := Unpack8(T8("hello", 2, true, foo{bar: "bar"}, 4.2, "plop", false, 42))
fmt.Printf("%v %v %v %v %v %v %v %v", a, b, c, d, e, f, g, h)
// Output: hello 2 true {bar} 4.2 plop false 42
}
func ExampleUnpack9() {
a, b, c, d, e, f, g, h, i := Unpack9(T9("hello", 2, true, foo{bar: "bar"}, 4.2, "plop", false, 42, "hello world"))
fmt.Printf("%v %v %v %v %v %v %v %v %v", a, b, c, d, e, f, g, h, i)
// Output: hello 2 true {bar} 4.2 plop false 42 hello world
}
func ExampleZip2() {
result := Zip2([]string{"hello"}, []int{2})
fmt.Printf("%v", result)
// Output: [{hello 2}]
}
func ExampleZip3() {
result := Zip3([]string{"hello"}, []int{2}, []bool{true})
fmt.Printf("%v", result)
// Output: [{hello 2 true}]
}
func ExampleZip4() {
result := Zip4([]string{"hello"}, []int{2}, []bool{true}, []foo{{bar: "bar"}})
fmt.Printf("%v", result)
// Output: [{hello 2 true {bar}}]
}
func ExampleZip5() {
result := Zip5([]string{"hello"}, []int{2}, []bool{true}, []foo{{bar: "bar"}}, []float64{4.2})
fmt.Printf("%v", result)
// Output: [{hello 2 true {bar} 4.2}]
}
func ExampleZip6() {
result := Zip6([]string{"hello"}, []int{2}, []bool{true}, []foo{{bar: "bar"}}, []float64{4.2}, []string{"plop"})
fmt.Printf("%v", result)
// Output: [{hello 2 true {bar} 4.2 plop}]
}
func ExampleZip7() {
result := Zip7([]string{"hello"}, []int{2}, []bool{true}, []foo{{bar: "bar"}}, []float64{4.2}, []string{"plop"}, []bool{false})
fmt.Printf("%v", result)
// Output: [{hello 2 true {bar} 4.2 plop false}]
}
func ExampleZip8() {
result := Zip8([]string{"hello"}, []int{2}, []bool{true}, []foo{{bar: "bar"}}, []float64{4.2}, []string{"plop"}, []bool{false}, []int{42})
fmt.Printf("%v", result)
// Output: [{hello 2 true {bar} 4.2 plop false 42}]
}
func ExampleZip9() {
result := Zip9([]string{"hello"}, []int{2}, []bool{true}, []foo{{bar: "bar"}}, []float64{4.2}, []string{"plop"}, []bool{false}, []int{42}, []string{"hello world"})
fmt.Printf("%v", result)
// Output: [{hello 2 true {bar} 4.2 plop false 42 hello world}]
}
func ExampleUnzip2() {
a, b := Unzip2([]Tuple2[string, int]{T2("hello", 2)})
fmt.Printf("%v %v", a, b)
// Output: [hello] [2]
}
func ExampleUnzip3() {
a, b, c := Unzip3([]Tuple3[string, int, bool]{T3("hello", 2, true)})
fmt.Printf("%v %v %v", a, b, c)
// Output: [hello] [2] [true]
}
func ExampleUnzip4() {
a, b, c, d := Unzip4([]Tuple4[string, int, bool, foo]{T4("hello", 2, true, foo{bar: "bar"})})
fmt.Printf("%v %v %v %v", a, b, c, d)
// Output: [hello] [2] [true] [{bar}]
}
func ExampleUnzip5() {
a, b, c, d, e := Unzip5([]Tuple5[string, int, bool, foo, float64]{T5("hello", 2, true, foo{bar: "bar"}, 4.2)})
fmt.Printf("%v %v %v %v %v", a, b, c, d, e)
// Output: [hello] [2] [true] [{bar}] [4.2]
}
func ExampleUnzip6() {
a, b, c, d, e, f := Unzip6([]Tuple6[string, int, bool, foo, float64, string]{T6("hello", 2, true, foo{bar: "bar"}, 4.2, "plop")})
fmt.Printf("%v %v %v %v %v %v", a, b, c, d, e, f)
// Output: [hello] [2] [true] [{bar}] [4.2] [plop]
}
func ExampleUnzip7() {
a, b, c, d, e, f, g := Unzip7([]Tuple7[string, int, bool, foo, float64, string, bool]{T7("hello", 2, true, foo{bar: "bar"}, 4.2, "plop", false)})
fmt.Printf("%v %v %v %v %v %v %v", a, b, c, d, e, f, g)
// Output: [hello] [2] [true] [{bar}] [4.2] [plop] [false]
}
func ExampleUnzip8() {
a, b, c, d, e, f, g, h := Unzip8([]Tuple8[string, int, bool, foo, float64, string, bool, int]{T8("hello", 2, true, foo{bar: "bar"}, 4.2, "plop", false, 42)})
fmt.Printf("%v %v %v %v %v %v %v %v", a, b, c, d, e, f, g, h)
// Output: [hello] [2] [true] [{bar}] [4.2] [plop] [false] [42]
}
func ExampleUnzip9() {
a, b, c, d, e, f, g, h, i := Unzip9([]Tuple9[string, int, bool, foo, float64, string, bool, int, string]{T9("hello", 2, true, foo{bar: "bar"}, 4.2, "plop", false, 42, "hello world")})
fmt.Printf("%v %v %v %v %v %v %v %v %v", a, b, c, d, e, f, g, h, i)
// Output: [hello] [2] [true] [{bar}] [4.2] [plop] [false] [42] [hello world]
}