Multiple simultaneous assignments from another struct with set #14
Labels
No labels
bug
duplicate
enhancement/documentation
enhancement/feature
enhancement/organization
question
rejected
upstream
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
UserCurt/mpath#14
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One use case that may often be employed is to copy data from one struct to another, possibly with different hierarchical structures. This feature request is to ease this process by integrating
mpath.getas a part ofmpath.set, piggybacking off of multiple simultaneous different assignments described in #13. The set function would have an additional input. Below is an example. An approach using solely the method from #13 is included for comparison. This example assigns every field, but this does not have to be the case generally.The example has become a bit simpler, no longer needing
num2cellwhile being more robust usingUniformValues=false: