Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNil ¶
func IsNil(i interface{}) bool
IsNil returns true if the parameter is:
- untyped nil (<nil, nil>)
- a nil value with some fixed type, e.g., (<io.Reader, nil>)
It differs from '== nil' in that a pointer to some type will still be considered nil if it is being passed to an interface.
Because this uses reflection it is much slower than a direct comparison to nil but is generally <100 microseconds per check. In a tight loop with a potentially very large number of iterations this may be a consideration.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.