Run starts the specified command and waits for it to complete.
package main import ( "log" "os/exec" ) func main() { cmd := exec.Command("sleep", "1") log.Printf("Running command and waiting for it to finish...") err := cmd.Run() log.Printf("Command finished with error: %v", err) }