Skip to content

Commit

Permalink
Updated comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pboothe committed Oct 21, 2019
1 parent d8bab5f commit 2f3c7a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eventsocket/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ func MustRun(ctx context.Context, socket string, handler Handler) {
// unexported. The error it gives you should be treated the same as EOF,
// because it corresponds to the connection terminating under normal
// conditions. Because Scanner hides the EOF error, it should also hide the
// unexported one. Because Scanner doesn't, we do so here.
// unexported one. Because Scanner doesn't, we do so here. Other errors
// should not be hidden.
//
// TL;DR: err is non-nil under normal operations. Make it nil in that case.
err = s.Err()
if strings.Contains(err.Error(), "use of closed network connection") {
err = nil
Expand Down

0 comments on commit 2f3c7a7

Please sign in to comment.