Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diff ¶
type Diff struct { Field string // values of which field are different? Expected interface{} // expected value Actual interface{} // actual value }
the diff between the expected and the actual on exactly the same field if Field remains empty, that means the very root
func Compare ¶
compare the given data, and returns the specific diffs if some expected's field does not appear in actual, an error would be thrown immediately NOTE: only public fields could be considered This function is supposed to be able to 1. compare fields recursively; 2. handle circular reference.
This function CANNOT 1. be thread-safe. 2. expected and actual are not exactly the same type (fields in expected is not consistent with actual)
Click to show internal directories.
Click to hide internal directories.