PointerOf returns a Pointer from v, which must be a reflect.Ptr, reflect.Slice, or reflect.Map.
(v reflect.Value)
| 18 | // PointerOf returns a Pointer from v, which must be a |
| 19 | // reflect.Ptr, reflect.Slice, or reflect.Map. |
| 20 | func PointerOf(v reflect.Value) Pointer { |
| 21 | // The proper representation of a pointer is unsafe.Pointer, |
| 22 | // which is necessary if the GC ever uses a moving collector. |
| 23 | return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} |
| 24 | } |
| 25 | |
| 26 | // IsNil reports whether the pointer is nil. |
| 27 | func (p Pointer) IsNil() bool { |