Documentation
¶
Overview ¶
Package prettyprint formats any go value in a way that is similar to the equivalent literal in a go source file. However, for the purpose of displaying intelligible values during testing, some details are elided, long string are line-wrapped with wrap delimiters, and long sequences are potentially truncated in the middle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = New()
Default is the default pretty-printer with globally chared config
Functions ¶
func FormatValue ¶
func FormatValue(v interface{}) string
FormatValue return a formated value using the default shared pretty-printer
Types ¶
type Formatter ¶
type Formatter struct {
Width int
WrapPrefix string
WrapSuffix string
MaxWrapped int
IndentStr string
NewlineStr string
}
Formatter contains the configuration
func New ¶
func New() *Formatter
New return a new pretty-printer that can be customized and used locally
func (*Formatter) FormatValue ¶
FormatValue return the value formated according to the local settings
Click to show internal directories.
Click to hide internal directories.