is – Reflective Assertions for Golang
is provides some assertions on
Go's reflect package can sometimes leave one asking basic questions, like
Is this a zero value? Is this field exported?
Although there are well-documented ways to answer these kinds of questions, discoverability can be hard.
I hope this package comes in handy for quick and dirty assertions, but would encourage you to use this code as inspiration to writing your own reflect code accurately and hopefully more efficiently.
Is this a zero value?
is.Zerochecks if a value is equal to the zero value of its underlying type.
is.ZeroForTypechecks if a value is equal to the zero value of the provided type.
These two functions are subtly different, check out the examples on godoc.