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

Method String

cmp/report.go:39–48  ·  view source on GitHub ↗

String provides a full report of the differences detected as a structured literal in pseudo-Go syntax. String may only be called after the entire tree has been traversed.

()

Source from the content-addressed store, hash-verified

37// literal in pseudo-Go syntax. String may only be called after the entire tree
38// has been traversed.
39func (r *defaultReporter) String() string {
40 assert(r.root != nil && r.curr == nil)
41 if r.root.NumDiff == 0 {
42 return ""
43 }
44 ptrs := new(pointerReferences)
45 text := formatOptions{}.FormatDiff(r.root, ptrs)
46 resolveReferences(text)
47 return text.String()
48}
49
50func assert(ok bool) {
51 if !ok {

Callers

nothing calls this directly

Calls 4

assertFunction · 0.85
resolveReferencesFunction · 0.85
FormatDiffMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected