Situation I am in:
I am writing an api testing tool. And want to compare the actual api results with an expected result.
What I want to archive:
These two structs of the type result should be compared based on the fields in expected_result.
Example
Now I want to only compare the fields b1,b2,b4 and also only if they are not empty (0,"",nil).
The other fields that are in api_result are not important.
Tried so far
I already dug into reflect.DeepEqual() and then into go-cmp. But with both is the problem that the compare functions are (or have to be) symmetric (func(x,y)==func(y,x)).
With that symetry I can't differntiate between the two compared items.
Thanks a lot for your ideas and help!