Documentation
¶
Overview ¶
Package nilcheck reports whether an interface value has nothing behind it.
It exists because redis-kit's constructors take redis.UniversalClient rather than *redis.Client. A concrete pointer parameter made "no client" a single state that `== nil` recognised. An interface parameter splits it in two: a nil interface, and a non-nil interface holding a nil pointer -- which is what a caller passes from an unassigned struct field or a constructor that returned early:
var rdb *redis.Client // never assigned c := cache.NewCache(rdb, "") // c.client != nil, and every call panics
Every nil check in this module goes through IsNil so that case keeps returning "redis client is nil" instead of dereferencing a nil pointer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.