github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/types2/tuple.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package types2 6 7 // A Tuple represents an ordered list of variables; a nil *Tuple is a valid (empty) tuple. 8 // Tuples are used as components of signatures and to represent the type of multiple 9 // assignments; they are not first class types of Go. 10 type Tuple struct { 11 vars []*Var 12 } 13 14 // NewTuple returns a new tuple for the given variables. 15 func NewTuple(x ...*Var) *Tuple 16 17 // Len returns the number variables of tuple t. 18 func (t *Tuple) Len() int 19 20 // At returns the i'th variable of tuple t. 21 func (t *Tuple) At(i int) *Var 22 23 func (t *Tuple) Underlying() Type 24 func (t *Tuple) String() string