zero

package module
v0.0.0-...-0f738d0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: MIT Imports: 1 Imported by: 43

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDefaultVal

func IsDefaultVal(x interface{}) bool

IsDefaultVal alias of IsZeroVal

func IsZeroVal

func IsZeroVal(x interface{}) bool

IsZeroVal check if any type is its zero value

Types

This section is empty.

Jump to

Keyboard shortcuts

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