Standard library / reflect

reflect.Value.Kind()

Report the broad kind of the represented value; invalid Value returns Invalid. Expected stdout: 'int\n'.

Formal Syntax & Structure

go syntaxgo
func (v Value) Kind() Kind

Return Value

Kind

Report the broad kind of the represented value; invalid Value returns Invalid.

Working Example

Example Snippetgo
package main
import (  "fmt"  "reflect")
func main() { fmt.Println(reflect.ValueOf(42).Kind()) }
Go Reference