1// Copyright 2018, The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
12// Pointer is an opaque typed pointer and is guaranteed to be comparable.
18// PointerOf returns a Pointer from v, which must be a
19// reflect.Ptr, reflect.Slice, or reflect.Map.
20func 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()}
26// IsNil reports whether the pointer is nil.
27func (p Pointer) IsNil() bool {
31// Uintptr returns the pointer as a uintptr.
32func (p Pointer) Uintptr() uintptr {
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list