Discover Packages
git.sylvanbytes.org/finis/empty
package
module
Version:
v0.0.0-...-f8d9bd0
Opens a new window with list of versions in this module.
Published: May 12, 2019
License: GPL-3.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Coverage Report
Determine whether a library is empty or not. Built-in types are handles as follow. Use the Empty interface to extend functionality.
A value is empty if:
0 for integers of any type (e.g. int, int8...etc)
0.0 for floats of any type (e.g. float32, float 64)
maps without any keys
arrays with length of zero where each element satisfies its type specific empty criteria
Expand ▾
Collapse ▴
Documentation
¶
func IsEmpty(any interface{}) bool
IsEmpty returns true is the value is empty, false otherwise.
func IsPresent(any interface{}) bool
IsPresent returns true if the value is not empty, false otherwise.
func RegisterHandler ¶
RegisterHandler registers a particular type to a function that determines whether a value of that type is empty.
Useful for types that are in other libraries. However please consider using the EmptyValue interface
wherever possible.
func TimeIsEmpty(any interface{}) bool
TimeIsEmpty determines whether time.Time object is empty
type Value interface {
Empty() bool
}
Value is a piece of data that can either be present or not. Typically abstracts the concept of a null
or empty string.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.