ygot
ygot copied to clipboard
Don't accidentally create leaves using SetNode/GetOrCreateNode
2. going forward, we'll keep a note of the first entry that we initialise when doing `SetNode` or `GetOrCreate....`, and if the final call fails or is ignored (because it is a shadowpath), we'll uninitialise the first initialised node to undo our work. This will be for all use cases of this function.
Originally posted by @robshakir in https://github.com/openconfig/ygot/pull/543#discussion_r651359155
A TODO comment: https://github.com/openconfig/ygot/blob/master/ytypes/node.go#L508-L511
There is also currently a unit test for it that has a TODO.