Standard library / go/types

go/types.Builtin.Id()

Returns the unexported predeclared identifier with the underscore package qualifier in Go 1.23.2. Expected stdout: '_.len\n'.

Formal Syntax & Structure

go syntaxgo
func (obj *Builtin) Id() string

Return Value

string

Returns the unexported predeclared identifier with the underscore package qualifier in Go 1.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/types")
func main() { v := types.Universe.Lookup("len").(*types.Builtin); fmt.Println(v.Id()) }
Go Reference