There are 2 applications. How easy is it to run file2.exe from file1.exe?

    1 answer 1

    will help you package "os / exec"

    Run runs a command and waits for it to finish.

    Start starts and does not wait until you call Wait.

    example

    package main import ( "bytes" "fmt" "log" "os/exec" "strings" ) func main() { cmd := exec.Command("tr", "az", "AZ") cmd.Stdin = strings.NewReader("some input") var out bytes.Buffer cmd.Stdout = &out err := cmd.Run() if err != nil { log.Fatal(err) } fmt.Printf("in all caps: %q\n", out.String()) }