Merge pull request #416 from strukturag/golangci-fix

Explicitly use type "sysConn".
This commit is contained in:
Joachim Bauch 2023-02-07 10:06:37 +01:00 committed by GitHub
commit 955a623419
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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