mirror of https://github.com/rwxrob/bonzai
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
353 B
Go
24 lines
353 B
Go
package check_test
|
|
|
|
import (
|
|
"fmt"
|
|
"reflect"
|
|
|
|
"github.com/rwxrob/bonzai/check"
|
|
)
|
|
|
|
func ExampleIsNil() {
|
|
var names []string
|
|
var namesi interface{}
|
|
namesi = names
|
|
fmt.Println(names == nil)
|
|
fmt.Println(namesi == nil)
|
|
fmt.Println(reflect.ValueOf(namesi).IsNil())
|
|
fmt.Println(check.IsNil(namesi))
|
|
// Output:
|
|
// true
|
|
// false
|
|
// true
|
|
// true
|
|
}
|