package
module
Version:
v0.0.0-...-0f738d0
Opens a new window with list of versions in this module.
Published: Sep 21, 2019
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 43
Opens a new window with list of known importers.
README
¶
zero
Golang The zero value
Check if a variable is its type's zero value
or default value
The variable type can be any type:
- nil
- int
- float
- string
- slice
- struct
- channel
- map
- byte
- interface
Install
go get -u github.com/vikyd/zero
Usage
package main
import (
"fmt"
"github.com/vikyd/zero"
)
func main() {
var v int
fmt.Println(zero.IsZeroVal(v))
}
Thanks
newacct
Documentation
¶
func IsDefaultVal(x interface{}) bool
IsDefaultVal alias of IsZeroVal
func IsZeroVal(x interface{}) bool
IsZeroVal check if any type is its zero value
Source Files
¶
Click to show internal directories.
Click to hide internal directories.