Standard library / go/types

go/types.BasicKind

Enumerates basic type categories; use Typ to look up their descriptors. Expected stdout: 'int\n'.

Formal Syntax & Structure

go syntaxgo
type BasicKind int

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/types")
func main() { var k types.BasicKind = types.Int; fmt.Println(types.Typ[k].Name()) }
Go Reference