Standard library / reflect

reflect.Value.Type()

Return the exact runtime type. An invalid Value panics. Expected stdout: 'int\n'.

Formal Syntax & Structure

go syntaxgo
func (v Value) Type() Type

Return Value

Type

Return the exact runtime type.

Working Example

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