Looking for go Answers? Try Ask4KnowledgeBase
Looking for go Keywords? Try Ask4Keywords

Go Executing a Command then Continue and Wait


cmd := exec.Command("sleep", "5")

// Does not wait for command to complete before returning
err := cmd.Start()
if err != nil {

// Wait for cmd to Return
err = cmd.Wait()
log.Printf("Command finished with error: %v", err)