Standard library / reflect
reflect.Value.IsNil()
Check nil for chan, func, interface, map, pointer or slice values. Other kinds, including invalid, panic. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (v Value) IsNil() boolReturn Value
bool
Check nil for chan, func, interface, map, pointer or slice values.
Working Example
Example Snippetgo
package main
import ( "fmt" "reflect")
func main() { fmt.Println(reflect.ValueOf((*int)(nil)).IsNil()) }