Documentation
¶
Overview ¶
Example ¶
a := SampleStruct{
A: 1,
B: "b1",
C: OtherStruct{
A: []OtherStruct{{D: 1}, {D: 2}, {D: 3}},
D: 0,
E: false,
},
D: &OtherStruct{},
}
b := SampleStruct{
A: 2,
B: "b2",
C: OtherStruct{
A: []OtherStruct{{D: 1}, {D: 2}, {D: 4}},
D: 0,
E: false,
},
D: nil,
}
diffs := diff.Diffs(a, b)
for _, d := range diffs {
fmt.Printf("%v\n\n", d)
}
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonDiff ¶
type CommonDiff struct {
A interface{}
B interface{}
}
CommonDiff is a simple difference error between two values A and B.
func (CommonDiff) Error ¶
func (cd CommonDiff) Error() string
type Diff ¶
Diff is a structure pointing a difference on a variable Path (Deep navigation on attributes and indexes). A difference is reported in the Value attribute as un error.
type FuncDiff ¶
type FuncDiff CommonDiff
TypeDiff is a function difference error between two values A and B. (all functions are considered different).
type InvalidDiff ¶
InvalidDiff reports that one or both of the values A and B are in an Invalid State.
func (InvalidDiff) Error ¶
func (id InvalidDiff) Error() string
type KeyNotFoundDiff ¶
KeyNotFoundDiff reports that a Key exists only on A or B.
func (KeyNotFoundDiff) Error ¶
func (kd KeyNotFoundDiff) Error() string
type LenDiff ¶
type LenDiff struct {
CommonDiff
Value int
}
LenDiff reports a length different between A and B.
Click to show internal directories.
Click to hide internal directories.