Skip to content

Commit

Permalink
Used more standard approach for err
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Ridgway committed Nov 30, 2020
1 parent 73dce90 commit cde1566
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,14 @@ func (c *Conn) Send(destination, contentType string, body []byte, opts ...func(*
C: make(chan *frame.Frame),
}

sendErr := sendDataToWriteChWithTimeout(c.writeCh, request, c.msgSendTimeout)
if sendErr != nil {
return sendErr
err := sendDataToWriteChWithTimeout(c.writeCh, request, c.msgSendTimeout)
if err != nil {
return err
}

receiptErr := readReceiptWithTimeout(request, c.rcvReceiptTimeout)
if receiptErr != nil {
return receiptErr
err = readReceiptWithTimeout(request, c.rcvReceiptTimeout)
if err != nil {
return err
}
} else {
// no receipt required
Expand Down

0 comments on commit cde1566

Please sign in to comment.