public void labelAddress(Address addr, String symbolName, String namespaceName)
			throws IOException {
		try {
			SymbolTable symbolTable = program.getSymbolTable();
			Namespace ns = null;
			try {
				ns = (namespaceName == null || namespaceName.isBlank())
						? program.getGlobalNamespace()
						: program.getSymbolTable()
								.getOrCreateNameSpace(program.getGlobalNamespace(), namespaceName,
									SourceType.IMPORTED);
			}
			catch (DuplicateNameException e) {
				ns = program.getGlobalNamespace();
			}
			symbolName = SymbolUtilities.replaceInvalidChars(symbolName, true);
			Symbol newLabelSym = symbolTable.createLabel(addr, symbolName, ns, SourceType.IMPORTED);
			newLabelSym.setPrimary();
		}
		catch (InvalidInputException e) {
			logWarningAt(addr, "Failed to label [%s]: %s".formatted(symbolName, e.getMessage()));
		}
	}
Places a label at the specified address.

@param addr {@link Address}
@param symbolName name
@param namespaceName name of namespace to place the label symbol in, or null if root
@throws IOException if error
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/MarkupSession.java