Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/kylelemons/godebug

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/kylelemons/godebug

  • v1.1.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

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 cmp or go-spew.

FAQs

Package last updated on 05 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc