|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package check
|
|
|
|
|
|
|
|
|
|
import "reflect"
|
|
|
|
|
|
|
|
|
|
// Blank checks that the passed string, []byte (or slice of either)
|
|
|
|
|
// contains something besides an empty string.
|
|
|
|
|
func Blank(i interface{}) bool {
|
|
|
|
@ -19,3 +21,10 @@ func Blank(i interface{}) bool {
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IsNil is a shortcut for reflect.ValueOf(foo).IsNil() and should only
|
|
|
|
|
// be used when foo == nil is in question, such as whenever the value of
|
|
|
|
|
// foo is an interface of any kind. In fact, every interface should use
|
|
|
|
|
// this check instead just to be sure to avoid surprise (and extremely
|
|
|
|
|
// odd) logic errors. Nil is not "nil" in Go.
|
|
|
|
|
func IsNil(i interface{}) bool { return reflect.ValueOf(i).IsNil() }
|
|
|
|
|