Categorygithub.com/vikyd/zero
modulepackage
0.0.0-20190921142904-0f738d0bc858
Repository: https://github.com/vikyd/zero.git
Documentation: pkg.go.dev

# 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

# Functions

IsDefaultVal alias of IsZeroVal.
IsZeroVal check if any type is its zero value.