SetUniqueName sets the name of the node to be unique, using the number of lifetime children of the parent node as a unique identifier. If the node already has a name, it adds the unique id to it. Otherwise, it uses the type name of the node plus the unique id.
(n Node)
| 149 | // identifier. If the node already has a name, it adds the unique id |
| 150 | // to it. Otherwise, it uses the type name of the node plus the unique id. |
| 151 | func SetUniqueName(n Node) { |
| 152 | setUniqueName(n, true) |
| 153 | } |
| 154 | |
| 155 | // setUniqueName is the implementation of [SetUniqueName] that takes whether |
| 156 | // to add the unique id to the name even if it is already set. |