commit | b5f2db3a80008e65bb59c50afef0f13ce699e58c | [log] [tgz] |
---|---|---|
author | Keith Rarick <kr@xph.us> | Thu Jan 13 19:27:36 2011 -0800 |
committer | Keith Rarick <kr@xph.us> | Thu Jan 13 19:27:36 2011 -0800 |
tree | e9d0491f49f2ed7d2cc7e9b254d05d58fc97f611 | |
parent | bc50154b02bfb626046eba00feb3821f018c84ea [diff] |
rename
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.
$ goinstall github.com/kr/pretty.go
then
import "github.com/kr/pretty.go"