How to execute shell command with another user in GO, and get output from it ?
I tried:
cmd :=exec.Command("sudo","su",username, "-c",command)
stdout, err := cmd.StdoutPipe()
CheckErr(err)
cmd.Run()
there is no output. anyone know how to do this?