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

     1  # breflect
     2  
     3  ## API
     4  
     5  - IsNil 判断是否为nil
     6  
     7  ## EXAMPLE
     8  
     9  ```go
    10  package main
    11  
    12  import (
    13  	"fmt"
    14  	"github.com/songzhibin97/go-baseutils/base/breflect"
    15  )
    16  
    17  func main() {
    18  	var a int
    19  	fmt.Println(breflect.IsNil(a)) // false
    20  	var b int
    21  	fmt.Println(breflect.IsNil(&b)) // false
    22  	var c *int
    23  	fmt.Println(breflect.IsNil(c))  // true
    24  	fmt.Println(breflect.IsNil(&c)) // true
    25  }
    26  ```