Documentation ¶
Overview ¶
Package structuraldiff provides best-effort prettyprinting and diffing of pretty-printed values.
The output of any method in this package is not remotely stable. Use at your own risk.
As a quick word of caution, both DebugDump and DebugEqual are intentionally abstraction-breaking and will NOT ignore unexported fields. Other packages like go-cmp will ignore unexported fields and will make you pass in an option to prove that you own the struct in question and can look at its fields.
We don't do that. You can always see everything.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugDump ¶
DebugDump is an extremely abstraction-breaking function that will print a Go Value.
It prints zero values and unexported field, but does NOT ignore user-defined methods for pretty-printing. It SHOULD ignore user-defined methods for pretty-printing, but this causes issues with infinite recursion when printing protos.
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
A Result is either a list of diffs
func DebugCompare ¶
DebugCompare compares two values of the same type and produces a structural diff between them.
If we can't detect a difference between the two structures, return an apologetic message but NOT a nil result. That way we can compare the Result to nil to see if there were any problems.