Standard library / go/types

go/types.Builtin.String()

Formats the declaration for human-readable diagnostics; do not parse this representation as a stable format. Expected stdout: 'true\n'.

Formal Syntax & Structure

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

Return Value

string

Formats the declaration for human-readable diagnostics; do not parse this representation as a stable format.

Working Example

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