MCPcopy Create free account
hub / github.com/cogentcore/core / SetUniqueName

Function SetUniqueName

tree/admin.go:151–153  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
151func 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.

Callers 4

InlineParentMethod · 0.92
AddFromLibraryMethod · 0.92
UnmarshalXMLMethod · 0.92
TestSetUniqueNameFunction · 0.85

Calls 1

setUniqueNameFunction · 0.85

Tested by 1

TestSetUniqueNameFunction · 0.68