diff --git a/src/git.xdrm.io/schastsp/client/client.go b/src/git.xdrm.io/schastsp/client/client.go index a4c99e2..eeaa375 100644 --- a/src/git.xdrm.io/schastsp/client/client.go +++ b/src/git.xdrm.io/schastsp/client/client.go @@ -99,12 +99,8 @@ func (c *T) Receive(r io.Reader) error { ---------------------------------------------------------*/ errCode := make([]byte, 1) read, err := r.Read(errCode) - if err != nil { - return err - } - if uint16(read) != 1 { - return errors.New("Cannot read enough bytes") - } + if err != nil { return err } + if uint16(read) != 1 { return errors.New("Cannot read enough bytes") } /* (2) Manage success ---------------------------------------------------------*/ @@ -128,22 +124,14 @@ func (c *T) Receive(r io.Reader) error { /* (1) Read y1 */ y1 := make([]byte, scha.HSIZE) read, err = r.Read(y1) - if err != nil { - return err - } - if uint16(read) != scha.HSIZE { - return errors.New("Cannot read enough bytes") - } + if err != nil { return err } + if uint16(read) != scha.HSIZE { return errors.New("Cannot read enough bytes") } /* (2) Read y2 */ y2 := make([]byte, scha.HSIZE) read, err = r.Read(y2) - if err != nil { - return err - } - if uint16(read) != scha.HSIZE { - return errors.New("Cannot read enough bytes") - } + if err != nil { return err } + if uint16(read) != scha.HSIZE { return errors.New("Cannot read enough bytes") } /* (3) Manage rescue mode */ err = c.rescue(y1, y2)