My GO application needs to receive it's input from a pipeline and at the same time must prompt the user for the password. Because I don't like set the password in a command parameter, I would like implement it exactly like sudo
command does.
If I try to read from the stdin I will receive last command output as password (obviously). I have also tried to use this library https://github.com/howeyc/gopass but it reads only from stdin.
Is there a way to do that in GO?
You can't, and that has nothing to do with go. When you pipe to a program, you're directing the stdout of one program to the stdin of that program instead of the tty (what stdin would normally be attached to). A program only gets one stdin, so you can't both receive input piped from the output of another program, and receive input from the user's tty.