[go] how I can run program in another program?

Can I run the program in the program?
But, as a second program to have an array of bytes?
In other words, how can I run an array of bytes (go lang program) from memory?

Microservices?

i need something like that
An array of bytes is loaded into memory and executed as a normal program

I don’t think this is possible. Have you considered writing that program out to disk and running it from there?

yes, how I can do this?

Use os.File and its methods to write the file to disk, then use os.exit.Cmd and its methods to run the program.

1 Like

You can create and call a small gRPC server and execute whatever you want. AFAIK.

can u pls write example?

This is what a kernel does :wink:

)))George that is kernel does?) I hear it for the first time

No. I am struggling with this as well. Read all about gRPC-servers. I have managed to do a http server, But gRPC-server seems to be better for microservices. Small applications that works together.

Something like this: grpc-go/examples/helloworld/greeter_server/main.go at master · grpc/grpc-go · GitHub

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.