Skip to content
Snippets Groups Projects
Commit 087a80ec authored by Malte Bauch's avatar Malte Bauch
Browse files

added mergeoption to the openconfig unmarshal func

this allows to update values of the devices ygot.GoStruct and therefore
it is possible to request paths with changing values multiple times.
parent c0b8b690
No related branches found
No related tags found
1 merge request!210Resolve "Some paths of a device cant be requested more than once"
Pipeline #85358 failed
This commit is part of merge request !210. Comments created here will be created in the context of that merge request.
...@@ -114,7 +114,8 @@ func unmarshal(schema *ytypes.Schema, bytes []byte, fields []string, goStruct yg ...@@ -114,7 +114,8 @@ func unmarshal(schema *ytypes.Schema, bytes []byte, fields []string, goStruct yg
return err return err
} }
ygot.PruneEmptyBranches(validatedDeepCopy) ygot.PruneEmptyBranches(validatedDeepCopy)
return ygot.MergeStructInto(goStruct, validatedDeepCopy)
return ygot.MergeStructInto(goStruct, validatedDeepCopy, &ygot.MergeOverwriteExistingFields{})
} }
// getField traverses the GoStruct and returns the field that represents the // getField traverses the GoStruct and returns the field that represents the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment