1
2
3
4
5
6
7
8
9
10 package main
11
12 func complexArgs() (float64, float64) {
13 return 5, 7
14 }
15
16 func appendArgs() ([]string, string) {
17 return []string{"foo"}, "bar"
18 }
19
20 func appendMultiArgs() ([]byte, byte, byte) {
21 return []byte{'a', 'b'}, '1', '2'
22 }
23
24 func main() {
25 if c := complex(complexArgs()); c != 5+7i {
26 panic(c)
27 }
28
29 if s := append(appendArgs()); len(s) != 2 || s[0] != "foo" || s[1] != "bar" {
30 panic(s)
31 }
32
33 if b := append(appendMultiArgs()); len(b) != 4 || b[0] != 'a' || b[1] != 'b' || b[2] != '1' || b[3] != '2' {
34 panic(b)
35 }
36 }
37
View as plain text