Crypto ssh how to read the stdout pipe end?

I am a bit confused on what you are trying to achieve, but if stdout is not writable, you get an error when you write to it. (Not EOF, as that happens only when reading.)

In other words, check the return from your fmt.Println.

Also, I think you can use ioutil.ReadAll somewhere there, but again, I didn’t try to follow the code carefully.