Explicitly use type "sysConn".

Fixes error with newer versions of golangci-lint.
This commit is contained in:
Joachim Bauch 2023-02-07 09:04:35 +01:00
parent 2df1dc467a
commit e1761da4a8
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02

View file

@ -47,12 +47,12 @@ type syscallConn struct {
// This function returns newConn if rawConn doesn't implement syscall.Conn.
func WrapSyscallConn(rawConn, newConn net.Conn) net.Conn {
sysConn, ok := rawConn.(syscall.Conn)
sc, ok := rawConn.(sysConn)
if !ok {
return newConn
return &syscallConn{
Conn: newConn,
sysConn: sysConn,
sysConn: sc,