Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
record both old and new value of modified fields
This is to support alternative output formats than the one implemented by PrettyDiff. Most notably, with this change it would be trivial to implement a pretty-printed with output similar to that of the `diff` tool, which can display a modified field as follows: -path: old_value +path: new_value Prior to this commit, only the new value was recorded, so producing output such as the one examplified above would require traversing the `a` parameter passed to DeepDiff, and such traversal would require an extensive use of reflect, essentially re-implementing the core of messagediff. Therefore, to allow for broader use-cases of messagediff, the API is adjusted to include both the old and the new value for modified fields. This may be considered a backwards incompatible change to the API, in particular the type of the Modified field of the Diff struct has been updated. Users of PrettyPrint still have the same functionality, and all test cases pass without any modifications, so it may be possible to argue that this API change is more considered an internal detail, than something facing the average user. In either case, the added functionalty may warrant the update to the API.
- Loading branch information
7e0a312
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @d4l3k,
Please, release na new version with this patch =)