@Override
	public DataType recoverDataType(GoTypeManager goTypes) throws IOException {
		DataTypeManager dtm = goTypes.getDTM();
		String name = goTypes.getTypeName(this);
		CategoryPath cp = goTypes.getCP(this);

		StructureDataType struct = new StructureDataType(cp, name, (int) typ.getSize(), dtm);
		DataType structPtr = dtm.getPointer(struct);

		FunctionDefinitionDataType funcDef = new FunctionDefinitionDataType(cp, name + "_F", dtm);
		struct.replace(0, dtm.getPointer(funcDef), -1, "F", null);
		struct.add(new ArrayDataType(goTypes.getUint8DT(), 0), "context", null);
		struct.setToDefaultPacking();

		// pre-push an partially constructed struct into the cache to prevent endless recursive loops
		goTypes.cacheRecoveredDataType(this, structPtr);

		List<GoType> paramTypes = getParamTypes();
		List<GoType> inParamTypes = paramTypes.subList(0, inCount);
		List<GoType> outParamTypes = paramTypes.subList(inCount, paramTypes.size());

		List<ParameterDefinition> params = new ArrayList<>();
		params.add(
			new ParameterDefinitionImpl(GOLANG_CLOSURE_CONTEXT_NAME, dtm.getPointer(struct), null));

		for (GoType paramType : inParamTypes) {
			DataType paramDT = goTypes.getGhidraDataType(paramType);
			params.add(new ParameterDefinitionImpl(null, paramDT, null));
		}

		DataType returnDT;
		if (outParamTypes.size() == 0) {
			returnDT = VoidDataType.dataType;
		}
		else if (outParamTypes.size() == 1) {
			returnDT = goTypes.getGhidraDataType(outParamTypes.get(0));
		}
		else {
			List<DataType> paramDataTypes = new ArrayList<>();
			for (GoType outParamType : outParamTypes) {
				paramDataTypes.add(goTypes.getGhidraDataType(outParamType));
			}
			returnDT = goTypes.getFuncMultiReturn(paramDataTypes);
		}

		funcDef.setArguments(params.toArray(ParameterDefinition[]::new));
		funcDef.setReturnType(returnDT);


		// TODO: typ.getSize() should be ptrsize, and struct size should also be ptrsize

		return structPtr;
	}
Returns a string that describes the function type as a golang-ish function decl.

@param funcName optional name of a function
@return golang func decl string
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/rtti/types/GoFuncType.java