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

Function formatPointer

cmp/report_references.go:22–31  ·  view source on GitHub ↗

formatPointer prints the address of the pointer.

(p value.Pointer, withDelims bool)

Source from the content-addressed store, hash-verified

20
21// formatPointer prints the address of the pointer.
22func formatPointer(p value.Pointer, withDelims bool) string {
23 v := p.Uintptr()
24 if flags.Deterministic {
25 v = 0xdeadf00f // Only used for stable testing purposes
26 }
27 if withDelims {
28 return pointerDelimPrefix + formatHex(uint64(v)) + pointerDelimSuffix
29 }
30 return formatHex(uint64(v))
31}
32
33// pointerReferences is a stack of pointers visited so far.
34type pointerReferences [][2]value.Pointer

Callers 3

wrapTrunkReferenceFunction · 0.85
makeLeafReferenceFunction · 0.85
FormatValueMethod · 0.85

Calls 2

formatHexFunction · 0.85
UintptrMethod · 0.80

Tested by

no test coverage detected