【发布时间】:2014-08-13 10:17:48
【问题描述】:
我是围棋初学者。
我想使用来自 How would you define a pool of goroutines to be executed at once in Golang? 的代码 sn-p (this answer)
我需要检查每个执行的 cmd 的错误,如下所示:
out, err := exec.Command(cmd,params).Output()
但是,在 sn-p 中没有错误检查:
tasks <- exec.Command("zenity", "--info", "--text='Hello from iteration n."+strconv.Itoa(i)+"'")
cmd执行时如何检查错误?
【问题讨论】: