Standardize on only two value dumping/diffing libraries #669
+61
−89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to the quite messy heritage of this codebase -- including a large part of it starting as a fork of my earlier personal project ZCL, which had made different choices -- there were many different conventions for how to pretty-print and diff values in the tests in different parts of the codebase.
To reduce the dependency sprawl, this commit now standardizes on:
github.com/davecgh/go-spew
for pretty-printinggithub.com/google/go-cmp
for diffingThese two dependencies were already present anyway, are the most general out of all of the candidates, and are also already in use by at least some of HCL's most significant callers, such as HashiCorp Terraform.
Since this potentially affects how the tests report failure, I visited each test I changed and made it intentionally fail to verify that the result is still readable and includes similar information as before, even though some of them are now displaying slightly differently.
This only changes
_test.go
files, so it cannot affect any real behavior of the library when consumed by other modules.