Standard library / go/types
go/types.Builtin.Type()
Returns the associated type; builtins and import names do not have ordinary value types. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (obj *Builtin) Type() TypeReturn Value
Type
Returns the associated type; builtins and import names do not have ordinary value types.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/types")
func main() { v := types.Universe.Lookup("len").(*types.Builtin); fmt.Println(v.Type() != nil) }