Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

Commit

Permalink
Return *DetachError instead of DetachError
Browse files Browse the repository at this point in the history
This works as a pointer or non-pointer, but it's easier to enforce
consistency by fulfilling the error interface with a pointer receiver.
  • Loading branch information
vcabbage committed Jul 26, 2018
1 parent 5dba116 commit 4b9cda8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ type DetachError struct {
RemoteError *Error
}

func (e DetachError) Error() string {
func (e *DetachError) Error() string {
return fmt.Sprintf("link detached, reason: %+v", e.RemoteError)
}

Expand Down Expand Up @@ -1198,7 +1198,7 @@ func (l *link) muxHandleFrame(fr frameBody) error {
// set detach received and close link
l.detachReceived = true

return errorWrapf(DetachError{fr.Error}, "received detach frame")
return errorWrapf(&DetachError{fr.Error}, "received detach frame")

case *performDisposition:
debug(3, "RX: %s", fr)
Expand Down

0 comments on commit 4b9cda8

Please sign in to comment.