ingress-nginx-helm/vendor/github.com/kylelemons/godebug
Manuel de Brito Fontes bf5616c65b Replace godep with dep
2017-10-06 17:26:14 -03:00
..
diff Replace godep with dep 2017-10-06 17:26:14 -03:00
pretty Replace godep with dep 2017-10-06 17:26:14 -03:00
.travis.yml Replace godep with dep 2017-10-06 17:26:14 -03:00
LICENSE Add tests and godebug to compare structs 2017-01-13 10:26:13 -03:00
README.md Replace godep with dep 2017-10-06 17:26:14 -03:00

Pretty Printing for Go

godebug build status

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!

Quick Examples

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

Documentation for this package is available at godoc.org:

  • Pretty: godoc for godebug/pretty
  • Diff: godoc for godebug/diff

Installation

These packages are available via go get:

$ go get -u github.com/kylelemons/godebug/{pretty,diff}

Other Packages

If godebug/pretty is not granular enough, I highly recommend checking out go-spew.