Replace error check to errors.Is

This commit is contained in:
Zoltan Papp
2024-10-09 14:02:23 +02:00
parent b04d19bb0a
commit 1814b07a4b

View File

@@ -4,6 +4,7 @@ package ebpf
import (
"context"
"errors"
"fmt"
"io"
"net"
@@ -115,7 +116,7 @@ func (p *ProxyWrapper) readFromRemote(ctx context.Context, buf []byte) (int, err
if ctx.Err() != nil {
return 0, ctx.Err()
}
if err != io.EOF {
if !errors.Is(err, io.EOF) {
log.Errorf("failed to read from turn conn (endpoint: :%d): %s", p.wgEndpointAddr.Port, err)
}
return 0, err