소스 검색

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."
Kevin Tan 7 년 전
부모
커밋
79bdc2910d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      eBook/13.6.md

+ 1 - 1
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)  //