go-mock-exec-command-example English is not my native language; please excuse typing errors. This is a simple example that represents how to mock the exec.Command(). Reference golang/go/src/os/exec/exec_test.go