...
Source file
src/go/types/tuple.go
1
2
3
4
5 package types
6
7
8
9
10 type Tuple struct {
11 vars []*Var
12 }
13
14
15 func NewTuple(x ...*Var) *Tuple {
16 if len(x) > 0 {
17 return &Tuple{vars: x}
18 }
19 return nil
20 }
21
22
23 func (t *Tuple) Len() int {
24 if t != nil {
25 return len(t.vars)
26 }
27 return 0
28 }
29
30
31 func (t *Tuple) At(i int) *Var { return t.vars[i] }
32
33 func (t *Tuple) Underlying() Type { return t }
34 func (t *Tuple) String() string { return TypeString(t, nil) }
35
View as plain text