Standard library / go/types

go/types.Basic.String()

Returns the basic type representation. Expected stdout: 'int\n'.

Formal Syntax & Structure

go syntaxgo
func (b *Basic) String() string

Return Value

string

Returns the basic type representation.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/types")
func main() { fmt.Println(types.Typ[types.Int].String()) }
Go Reference