iszero: 4d63.com/iszero Index | Examples | Files

package iszero

import "4d63.com/iszero"

Index

Examples

Package Files

iszero.go

func Value Uses

func Value(v reflect.Value) bool

Value determines of the value is a zero value, which is the value the type has if declared without a defined value.

Code:

var s0 string
s0Zero := iszero.Value(reflect.ValueOf(s0))

var s1 string = "hello world"
s1Zero := iszero.Value(reflect.ValueOf(s1))

fmt.Println("s0", s0Zero)
fmt.Println("s1", s1Zero)

Output:

s0 true
s1 false

Package iszero imports 1 packages (graph) and is imported by 2 packages. Updated 2017-09-25. Refresh now. Tools for package owners.