Standard library / go/types
go/types.Array.Elem()
Element type. Expected stdout: 'int\n'.
Formal Syntax & Structure
go syntaxgo
func (a *Array) Elem() TypeReturn Value
Type
Element type.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/types")
func main() { t := types.NewArray(types.Typ[types.Int], 3); fmt.Println(t.Elem()) }