Deep Copy: note: we use the copy from direction (instead of copy to), as the receiver is modified whereas the from is not and assignment is typically in the same direction. CopyFrom copies the data and children of the given node to this node. It is essential that the source node has unique names. It
(from Node)
| 660 | // should not be copied. Also, unexported fields are not copied. |
| 661 | // See [Node.CopyFieldsFrom] for more information on field copying. |
| 662 | func (n *NodeBase) CopyFrom(from Node) { |
| 663 | if from == nil { |
| 664 | slog.Error("tree.NodeBase.CopyFrom: nil source", "destinationNode", n) |
| 665 | return |
| 666 | } |
| 667 | copyFrom(n.This, from) |
| 668 | } |
| 669 | |
| 670 | // copyFrom is the implementation of [NodeBase.CopyFrom]. |
| 671 | func copyFrom(to, from Node) { |