commit | 64c05a1169679df54a811436d0668aec10a8ca9b | [log] [tgz] |
---|---|---|
author | santosh653 <70637961+santosh653@users.noreply.github.com> | Mon Nov 02 15:31:41 2020 |
committer | Kyle Lemons <kyle@kylelemons.net> | Sat Nov 07 05:56:11 2020 |
tree | a0b24dad947c216f517546914187dddcd0562b08 | |
parent | fa7b53cdfc9105c70f134574002f406232921437 [diff] |
Update .travis.yml Adding power support
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.