package main import ( "fmt" "reflect" ) func main() { x := 10 v := reflect.ValueOf(x) fmt.Printf("Value: %v, Type: %s\n", v, v.Type()) }
package main import ( "fmt" "reflect" ) type Person struct { Name string Age int } func main() { p := Person{"Alice", 30} v := reflect.ValueOf(p) fmt.Printf("Value: %v, Type: %s\n", v, v.Type()) }In this example, we have a struct `Person` and we create an instance of it. We then get the reflect.Value of this instance and print out its value and type information. Package Library: The reflect package is part of the Go standard libraries.