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: 45 modules, 53 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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