()
| 92 | } |
| 93 | |
| 94 | func ExampleIsNil() { |
| 95 | a := 1 |
| 96 | b := &a |
| 97 | c := &b |
| 98 | d := &c |
| 99 | e := &d |
| 100 | var f *int |
| 101 | |
| 102 | result1 := IsNil(a) |
| 103 | result2 := IsNil(b) |
| 104 | result3 := IsNil(c) |
| 105 | result4 := IsNil(d) |
| 106 | result5 := IsNil(e) |
| 107 | result6 := IsNil(f) |
| 108 | result7 := IsNil(nil) |
| 109 | |
| 110 | fmt.Println(result1) |
| 111 | fmt.Println(result2) |
| 112 | fmt.Println(result3) |
| 113 | fmt.Println(result4) |
| 114 | fmt.Println(result5) |
| 115 | fmt.Println(result6) |
| 116 | fmt.Println(result7) |
| 117 | |
| 118 | // Output: |
| 119 | // false |
| 120 | // false |
| 121 | // false |
| 122 | // false |
| 123 | // false |
| 124 | // true |
| 125 | // true |
| 126 | } |
| 127 | |
| 128 | func ExampleUnwrapOr() { |
| 129 | a := 123 |
nothing calls this directly
no test coverage detected
searching dependent graphs…