Slice values are deeply equal when all of the following are true: they are both nil or both non-nil, they have the same length, and either they point to the same initial entry of the same underlying array (that is, &x[0] == &y[0]) or their corresponding elements (up to length) are deeply equal.
Короче пофиксил вторым рекуррентным методом
func procMap(t *testing.T, methodName string, src, tmpl map[string]interface{}) {
for k, v := range tmpl {
if innerMap, ok := v.(map[string]interface{}); ok {
procMap(t, methodName, src[k].(map[string]interface{}), innerMap)
} else if innerList, ok := v.([]interface{}); ok {
procList(t, methodName, src[k].([]interface{}), innerList)
} else if v != src[k] {
t.Errorf(`[%s] Falsher Inhalt des Feldes "%s": %v aber %v erwartet`,
methodName, k, v, src[k])
}
}
}
func procList(t *testing.T, methodName string, src, tmpl []interface{}) {
for k, v := range tmpl {
if innerMap, ok := v.(map[string]interface{}); ok {
procMap(t, methodName, src[k].(map[string]interface{}), innerMap)
} else if innerList, ok := v.([]interface{}); ok {
procList(t, methodName, src[k].([]interface{}), innerList)
} else if v != src[k] {
t.Errorf(`[%s] Falsher Inhalt des Feldes "%s": %v aber %v erwartet`,
methodName, k, v, src[k])
}
}
}