reflect

package
v0.0.0-...-c8a214a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL