Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Verify rsync protocol version match prior to proceeding - Rebased on current master. #71

Merged
merged 7 commits into from
Jul 2, 2020
Prev Previous commit
Next Next commit
Remove go from io.Copy in internal/sync/sync.go#Version
  • Loading branch information
stephenwithav committed Jul 2, 2020
commit 21976c65f28b437d9df10a00ca4851444666ce32
4 changes: 2 additions & 2 deletions internal/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ func (s Sync) Version() (string, error) {
return "", err
}
buf := &bytes.Buffer{}
go io.Copy(buf, process.Stdout())
io.Copy(buf, process.Stdout())

err = process.Wait()
if code, ok := err.(wsep.ExitError); ok {
return "", fmt.Errorf("Version heck exit status: %v", code)
return "", fmt.Errorf("Version check exit status: %v", code)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return "", fmt.Errorf("Version check exit status: %v", code)
return "", fmt.Errorf("version check exit status: %v", code)

}
if err != nil {
return "", fmt.Errorf("Server version mismatch")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer returning the error here instead.

Expand Down