commit | 5ce225cb821158bebffbac67614f9887c9f8012a | [log] [tgz] |
---|---|---|
author | Jason McVetta <jason.mcvetta@gmail.com> | Fri Dec 21 19:11:10 2012 -0800 |
committer | Jason McVetta <jason.mcvetta@gmail.com> | Fri Dec 21 19:11:10 2012 -0800 |
tree | 0ad6221f8dffc3d90fe144e062c5fefe2611ad21 | |
parent | c6123a7570c9cd976f39fd67a7068805f01cff38 [diff] |
Make Documentation a subheading
Package pretty provides pretty-printing for Go values. This is useful during debugging, to avoid wrapping long output lines in the terminal.
It provides a function, Formatter, that can be used with any function that accepts a format string. For example,
type LongTypeName struct { longFieldName, otherLongFieldName int } func TestFoo(t *testing.T) { var x []LongTypeName{{1, 2}, {3, 4}, {5, 6}} t.Errorf("%# v", Formatter(x)) }
This package also provides a convenience wrapper for each function in package fmt that takes a format string.
See GoDoc for automatic documentation.
$ go get github.com/kr/pretty
then
import "github.com/kr/pretty"