From 79bdc2910d3b99bb1ea0009eb15d208ef4117ab8 Mon Sep 17 00:00:00 2001 From: Kevin Tan Date: Tue, 5 Feb 2019 13:12:47 +0800 Subject: [PATCH] fix: example code of startProcess (#572) the first element of `argv` should be the command self which is 'ps' in this case, as the official doc says: "The argv slice will become os.Args in the new process, so it normally starts with the program name." --- eBook/13.6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eBook/13.6.md b/eBook/13.6.md index e4c6e81..93d6a11 100644 --- a/eBook/13.6.md +++ b/eBook/13.6.md @@ -52,7 +52,7 @@ The process id is &{2054 0}total 2056 ```go // 2nd example: show all processes -pid, err = os.StartProcess("/bin/ps", []string{"-e", "-opid,ppid,comm"}, procAttr) +pid, err = os.StartProcess("/bin/ps", []string{"ps", "-e", "-opid,ppid,comm"}, procAttr) if err != nil { fmt.Printf("Error %v starting process!", err) //