read response in remote commands

This commit is contained in:
Gokcehan committed 2017-02-11 16:06:45 +03:00
1 parent 56d80e2074
commit 46a4378531
1 file changed
+10
+10
View File
@@ -166,5 +166,15 @@ func sendRemote(cmd string) error {
fmt.Fprintln(c, cmd) fmt.Fprintln(c, cmd)
s := bufio.NewScanner(c)
s.Scan()
fmt.Println(s.Text())
if s.Err() != nil {
return fmt.Errorf("reading response: %s", s.Err())
}
return nil return nil
} }