String provides a string representation of this diff
()
| 301 | |
| 302 | // String provides a string representation of this diff |
| 303 | func (diff *TreeDiff) String() string { |
| 304 | output := "" |
| 305 | if len(diff.missingLeft) > 0 { |
| 306 | output += "\n missingLeft : " |
| 307 | for _, node := range diff.missingLeft { |
| 308 | output += "\n " + node.GetPath() |
| 309 | } |
| 310 | } |
| 311 | if len(diff.missingRight) > 0 { |
| 312 | output += "\n missingRight : " |
| 313 | for _, node := range diff.missingRight { |
| 314 | output += "\n " + node.GetPath() |
| 315 | } |
| 316 | } |
| 317 | if len(diff.conflicts) > 0 { |
| 318 | output += "\n Diverging conflicts : " |
| 319 | for _, c := range diff.conflicts { |
| 320 | output += "\n " + c.NodeLeft.GetPath() |
| 321 | } |
| 322 | } |
| 323 | return output |
| 324 | } |
| 325 | |
| 326 | // Stats provides info about the diff internals |
| 327 | func (diff *TreeDiff) Stats() map[string]interface{} { |