Standard library / reflect
reflect.Value.IsZero()
Report whether the value is its type’s zero value. An invalid Value panics. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (v Value) IsZero() boolReturn Value
bool
Report whether the value is its type’s zero value.
Working Example
Example Snippetgo
package main
import ( "fmt" "reflect")
func main() { fmt.Println(reflect.ValueOf(0).IsZero()) }