A client has decided to convert some code to java in a binary using golang...
having this example in java:
[..]
String aa = java.lang.ProcessBuilder;
String bb = start;
String tsil = "somestuff.exe";
Class kj = Class.forName(aa);
Process w = (Process) kj.getMethod(bb).invoke(kj.getDeclaredConstructors()[0].newInstance(tsil));
InputStream error = w.getErrorStream();
OutputStream ot = w.getOutputStream();
[..]
which basically is:
Process process = new ProcessBuilder("somestuff.exe").start();
how can i do the same thing using the reflection and dynamic method invocation in golang to execute commands/ binaries like this:
cmd := exec.Command("somestuff.exe")
err := cmd.Start()
Aucun commentaire:
Enregistrer un commentaire