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.
()
| 37 | // literal in pseudo-Go syntax. String may only be called after the entire tree |
| 38 | // has been traversed. |
| 39 | func (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 | |
| 50 | func assert(ok bool) { |
| 51 | if !ok { |
nothing calls this directly
no test coverage detected