Replaces a number of error equality checks with errors.Is

Signed-off-by: redwrasse <mail@redwrasse.io>
This commit is contained in:
redwrasse
2024-09-03 16:02:24 -07:00
parent 2c53be7c5d
commit d4df7a902e
12 changed files with 52 additions and 42 deletions

View File

@@ -16,6 +16,7 @@ package proxy
import (
"context"
"errors"
"fmt"
"io"
mrand "math/rand"
@@ -427,7 +428,7 @@ func (s *server) ioCopy(dst io.Writer, src io.Reader, ptype proxyType) {
for {
nr1, err := src.Read(buf)
if err != nil {
if err == io.EOF {
if errors.Is(err, io.EOF) {
return
}
// connection already closed
@@ -545,7 +546,7 @@ func (s *server) ioCopy(dst io.Writer, src io.Reader, ptype proxyType) {
var nw int
nw, err = dst.Write(data)
if err != nil {
if err == io.EOF {
if errors.Is(err, io.EOF) {
return
}
select {