private void fixupMethodWrapperClosureFunc(GoFuncData funcData, Function func,
				GoType closureStructType) {
			// method wrappers (funcs that end with "-fm") are closures that take the same args as
			// the same-named method, but instead of taking a recv pointer as first arg, it takes
			// a closure pointer with the typical closure sruct layout, and with the
			// context payload being the expected recvr pointer.
			String methodName = func.getName();
			methodName = methodName.substring(0, methodName.length() - "-fm".length());
			GoFuncData methodFuncData = goBinary.getFunctionByName(methodName);
			if (methodFuncData == null) {
				try {
					DataType closureStructDT = goTypes.getGhidraDataType(closureStructType);
					List<Variable> closureParams =
						List.of(new ParameterImpl(GOLANG_CLOSURE_CONTEXT_NAME,
							goBinary.getDTM().getPointer(closureStructDT), closureContextRegister,
							program, SourceType.ANALYSIS));

					func.updateFunction(null, null, closureParams,
						FunctionUpdateType.CUSTOM_STORAGE, true, SourceType.ANALYSIS);

					methodWrapperFuncsFixed++;

					return;
				}
				catch (InvalidInputException | DuplicateNameException | IOException e) {
					Msg.error(this, "Failed to update closure func signature %s@%s"
							.formatted(func.getName(), func.getEntryPoint()),
						e);
				}
			}

			// If the base method is present in the binary (ie. for foo-fm, foo exists), copy
			// its arguments and replace its receiver param with the closure context struct
			Function methodFunc =
				program.getFunctionManager().getFunctionAt(methodFuncData.getFuncAddress());
			if (methodFunc == null) {
				return;
			}

			try {
				DataType closureStructDT = goTypes.getGhidraDataType(closureStructType);

				Parameter methodReturn = methodFunc.getReturn();
				Parameter[] methodParams = methodFunc.getParameters();
				methodParams[0] = new ParameterImpl(GOLANG_CLOSURE_CONTEXT_NAME,
					goBinary.getDTM().getPointer(closureStructDT), closureContextRegister, program,
					SourceType.ANALYSIS);
				func.updateFunction(null, methodReturn, FunctionUpdateType.CUSTOM_STORAGE, true,
					SourceType.ANALYSIS, methodParams);
				methodWrapperFuncsFixed++;
			}
			catch (IOException | InvalidInputException | DuplicateNameException e) {
				Msg.error(this, "Failed to update closure func signature %s@%s"
						.formatted(func.getName(), func.getEntryPoint()),
					e);
			}
		}
Partially fixup closure func signatures by matching a closure func (*.func1) with a
closure struct ( struct { F uintptr; X0 blah... } ), and giving the func a context param
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/GolangSymbolAnalyzer.java