commit | bde9f3c96d7aa052631925fa03b944627a335ffc | [log] [tgz] |
---|---|---|
author | Kyle Lemons <[email protected]> | Sat Aug 24 18:50:15 2019 |
committer | Kyle Lemons <[email protected]> | Sat Aug 24 18:50:15 2019 |
tree | 24720a593a1209b3b33d80346b2584e36d69b1f2 | |
parent | fbf057ca71bbbee6f568c47d1051fb17eba85357 [diff] |
travis: Remove support for versions of go before strings.Builder
Have you ever wanted to get a pretty-printed version of a Go data structure, complete with indentation? I have found this especially useful in unit tests and in debugging my code, and thus godebug was born!
By default, pretty will write out a very compact representation of a data structure. From the Print example:
{Name: "Spaceship Heart of Gold", Crew: {Arthur Dent: "Along for the Ride", Ford Prefect: "A Hoopy Frood", Trillian: "Human", Zaphod Beeblebrox: "Galactic President"}, Androids: 1, Stolen: true}
It can also produce a much more verbose, one-item-per-line representation suitable for computing diffs. See the documentation for more examples and customization.
Documentation for this package is available at godoc.org:
These packages are available via go get
:
$ go get -u github.com/kylelemons/godebug/{pretty,diff}
If godebug/pretty
is not granular enough, I highly recommend checking out cmp or go-spew.