Os Exec Sudo Command in Go -
in process of familiarizing myself go , goroutines have hit road block executing commands. format of these commands are: sudo find /folder -type f | while read i; sudo -s chmod 644 "$i"; done with code taken how execute system command in golang unknown arguments i'm trying execute command believe it's not executing due first argument being sudo, wrong. have 2 questions. when these commands fail run returned "exit status 1", there way more detailed error doing? question two, why getting "exit status 1" script? going on isn't supposed to? package main import ( "bufio" "fmt" "os" "os/exec" "strings" "sync" ) func execmd(cmd string, wg *sync.waitgroup) { parts := strings.fields(cmd) head := parts[0] // head @ point "sudo" parts = parts[1:len(parts)] out, err := exec.command(head,parts...).output() if err != nil { ...