github.com/songzhibin97/go-baseutils@v0.0.2-0.20240302024150-487d8ce9c082/base/breflect/example_test.go (about)

     1  package breflect
     2  
     3  import "fmt"
     4  
     5  func ExampleIsNil() {
     6  	var a int
     7  	fmt.Println(IsNil(a)) // false
     8  	var b int
     9  	fmt.Println(IsNil(&b)) // false
    10  	var c *int
    11  	fmt.Println(IsNil(c))  // true
    12  	fmt.Println(IsNil(&c)) // true
    13  }