Style tweak

This commit is contained in:
Chris Bednarski 2015-08-11 22:30:19 -07:00
parent dc3c55cf8e
commit 047382eec9
1 changed files with 2 additions and 4 deletions

View File

@ -207,17 +207,15 @@ func (c *Communicator) Download(src string, dst io.Writer) error {
return fmt.Errorf("Failed to open pipe: %s", err)
}
err = localCmd.Start()
if err != nil {
if err = localCmd.Start(); err != nil {
return fmt.Errorf("Failed to start download: %s", err)
}
numBytes, err := io.Copy(dst, pipe)
if err != nil {
return fmt.Errorf("Failed to pipe download: %s", err)
} else {
log.Printf("Copied %d bytes for %s", numBytes, src)
}
log.Printf("Copied %d bytes for %s", numBytes, src)
if err = localCmd.Wait(); err != nil {
return fmt.Errorf("Failed to download '%s' from container: %s", src, err)