In Ruby, you can use Kernel.exec to replace the current executing process by the one triggered.
Is it possible to do the same thing in Go?
This is the equivalent to Kernel.exec:
package main
import "fmt"
import "syscall"
func main() {
if err := syscall.Exec("/bin/ls", []string{"ls", "-l"}, []string{}); err != nil {
fmt.Println(err)
}
}
but it is not portable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With