MCPcopy
hub / github.com/google/go-cmp / Push

Method Push

cmp/report_references.go:55–64  ·  view source on GitHub ↗
(v reflect.Value)

Source from the content-addressed store, hash-verified

53}
54
55func (ps *pointerReferences) Push(v reflect.Value) (p value.Pointer, seen bool) {
56 p = value.PointerOf(v)
57 for _, pp := range *ps {
58 if p == pp[0] || p == pp[1] {
59 return p, true
60 }
61 }
62 *ps = append(*ps, [2]value.Pointer{p, p})
63 return p, false
64}
65
66func (ps *pointerReferences) Pop() {
67 *ps = (*ps)[:len(*ps)-1]

Callers

nothing calls this directly

Calls 1

PointerOfFunction · 0.92

Tested by

no test coverage detected