pretty
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package pretty implements a simple pretty-printer. It is intended fordebugging the output of tests.
It follows pointers and produces multi-line output for complex values likeslices, maps and structs.
Index¶
Constants¶
This section is empty.
Variables¶
var Indent = " "Indent is the string output at each level of indentation.
Functions¶
funcDiff¶added inv0.5.0
Diff compares the pretty-printed representation of two values. The secondreturn value reports whether the two values' representations are identical.If it is false, the first return value contains the diffs.
The output labels the first value "want" and the second "got".
Diff works by invoking the "diff" command. It will only succeed inenvironments where "diff" is on the shell path.
funcValue¶
func Value(v interface{}) valValue returns a value that will print prettily when used as anargument for the %v or %s format specifiers.With no flags, struct fields and map keys with default values are omitted.With the '+' or '#' flags, all values are displayed.
This package does not detect cycles. Attempting to print a Value thatcontains cycles will result in unbounded recursion.
Types¶
This section is empty.