MCPcopy Index your code
hub / github.com/duke-git/lancet / ExampleIsNil

Function ExampleIsNil

pointer/pointer_examples_test.go:94–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94func 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
128func ExampleUnwrapOr() {
129 a := 123

Callers

nothing calls this directly

Calls 1

IsNilFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…