Skip to content

Commit 8c68d4f

Browse files
committed
serve: remove deadcode
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
1 parent 050d18c commit 8c68d4f

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

serve.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ package jsonrpc2
55

66
import (
77
"context"
8-
"errors"
98
"fmt"
10-
"io"
119
"net"
1210
"os"
1311
"time"
@@ -129,23 +127,3 @@ func Serve(ctx context.Context, ln net.Listener, server StreamServer, idleTimeou
129127
}
130128
}
131129
}
132-
133-
// isClosingError reports whether the error occurs normally during the process of
134-
// closing a network connection.
135-
//
136-
// It uses imperfect heuristics that err on the side of false negatives,
137-
// and should not be used for anything critical.
138-
func isClosingError(err error) bool {
139-
if errors.Is(err, io.EOF) {
140-
return true
141-
}
142-
143-
// Per https://github.com/golang/go/issues/4373, this error string should not
144-
// change. This is not ideal, but since the worst that could happen here is
145-
// some superfluous logging, it is acceptable.
146-
if err.Error() == "use of closed network connection" {
147-
return true
148-
}
149-
150-
return false
151-
}

0 commit comments

Comments
 (0)