Standard library / go/types
go/types.Tuple.At()
Returns the variable at the given index. Expected stdout: 'x\n'.
Formal Syntax & Structure
go syntaxgo
func (t *Tuple) At(i int) *VarParameters & Attributes
| Name | Type | Description |
|---|---|---|
| i | int | Zero-based member index. |
Return Value
*Var
Returns the variable at the given index.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/types")
func main() { t := types.NewTuple(types.NewVar(0, nil, "x", types.Typ[types.Int])) fmt.Println(t.At(0).Name())}