Standard library / reflect

reflect.Value

A runtime view of a Go value. Check validity, kind, addressability and settability before accessing or modifying it. Expected stdout: 'false\ntrue\n'.

Formal Syntax & Structure

go syntaxgo
type Value struct {}

Working Example

Example Snippetgo
package main
import (  "fmt"  "reflect")
func main() {  var v reflect.Value  fmt.Println(v.IsValid())  n := 1  fmt.Println(reflect.ValueOf(&n).Elem().CanSet())}
Go Reference