Standard library / go/types
go/types.Array.Underlying()
Returns the underlying type. An unnamed composite type is its own underlying type. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (a *Array) Underlying() TypeReturn Value
Type
Returns the underlying type.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/types")
func main() { t := types.NewArray(types.Typ[types.Int], 3); fmt.Println(t.Underlying() == t) }