Skip to content

Commit 500a767

Browse files
committed
Implement TCP connection (tcpConn)
1 parent 0ccb39d commit 500a767

4 files changed

Lines changed: 1217 additions & 17 deletions

File tree

vnet/conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ loop:
181181
Op: "read",
182182
Net: c.locAddr.Network(),
183183
Addr: c.locAddr,
184-
Err: newTimeoutError("i/o timeout"),
184+
Err: errIOTimeout,
185185
}
186186
}
187187
}

vnet/errors.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ type timeoutError struct {
77
msg string
88
}
99

10-
func newTimeoutError(msg string) error {
11-
return &timeoutError{
12-
msg: msg,
13-
}
14-
}
10+
var errIOTimeout = &timeoutError{msg: "i/o timeout"} //nolint:gochecknoglobals
1511

1612
func (e *timeoutError) Error() string {
1713
return e.msg

0 commit comments

Comments
 (0)