Standard library / reflect
reflect.Value.IsValid()
Report whether a Value represents a value. The zero Value is invalid; most other methods panic on it. Expected stdout: 'false\n'.
Formal Syntax & Structure
go syntaxgo
func (v Value) IsValid() boolReturn Value
bool
Report whether a Value represents a value.
Working Example
Example Snippetgo
package main
import ( "fmt" "reflect")
func main() { fmt.Println(reflect.ValueOf(nil).IsValid()) }