The issue is not stably reproduced on mac. the code snippet is as below:
cmd := exec.Command("/bin/zsh", "-c", `brew info goland`)
cmd.SysProcAttr = &syscall.SysProcAttr{
Credential: &syscall.Credential{
Uid: 501,
Gid: 20,
Groups: []uint32{2, 3, 4},
},
}
output, err := cmd.CombinedOutput()
if err != nil {
println(err)
}
i run the process as root, and exec command with another user. It failed on some mac computer and report "fork/exec /bin/zsh invalid argument" error message. anybody know the cause? thanks~