Skip to content

Commit

Permalink
DTS399117: adding unmerge support for misc fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ythadhani committed Jan 18, 2022
1 parent ffd882d commit 8f1653b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ygot/unmerge.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ func unmergeStructs(baseVal, unmergeVal reflect.Value, schema *yang.Entry) error
return err
}
default:
return fmt.Errorf("field: %s has unsupported type: %s", ft.Name, unmergeField.Type().Name())
if diff := cmp.Diff(baseField.Interface(), unmergeField.Interface()); diff != "" {
return fmt.Errorf("field: '%s' in base and unmerge structs was not equal, (-base, +unmerge):\n%s", cschema.Name, diff)
}
baseField.Set(reflect.Zero(baseField.Type()))
}
}
if util.IsKeyedList(schema) {
Expand Down

0 comments on commit 8f1653b

Please sign in to comment.