static void execGoCmd(File goRoot, File cwd, Consumer<String> outputConsumer,
			String... args) throws IOException {
		File goToolBinary = null;
		if (goRoot != null) {
			goToolBinary = normalizeExecutablePath(new File(goRoot, "bin/go"));
		}
		else {
			goToolBinary = findInOSPathEnv("go");
		}
		if (goToolBinary == null || !goToolBinary.isFile()) {
			throw new IOException("missing go tool binary");
		}
		List<String> cmdArgs = new ArrayList<>();
		cmdArgs.add(goToolBinary.getPath());
		cmdArgs.addAll(List.of(args));

		ProcessBuilder goCmd = new ProcessBuilder(cmdArgs).redirectError(Redirect.DISCARD);
		if (cwd != null) {
			goCmd.directory(cwd);
		}

		if (goRoot != null) {
			Map<String, String> env = goCmd.environment();
			env.put("GOROOT", goRoot.getPath());
		}

		Process goCmdProcess = goCmd.start();
		BufferedReader inputReader = goCmdProcess.inputReader();

		String line;
		while ((line = inputReader.readLine()) != null) {
			outputConsumer.accept(line);
		}

		try {
			int exitValue = goCmdProcess.waitFor();
			if (exitValue != 0) {
				throw new IOException("Go cmd error: %d [%s]".formatted(exitValue, cmdArgs));
			}
		}
		catch (InterruptedException e) {
			throw new IOException(e);
		}
	}
Executes a go tool command, feeding the output of the command to the consumer.
 
@param goRoot optional path to a go install.  If null, go tool will be searched for in
the OS's PATH
@param cwd optional path to the working directory for the cmd
@param outputConsumer string consumer
@param args for the go tool command
@throws IOException if failure
Ghidra/Features/Base/src/test/java/ghidra/app/util/bin/format/golang/rtti/GoApiSnapshotGeneratorTest.java