Lint on pkg/* packages
- pkg/useragent - pkg/units - pkg/ulimit - pkg/truncindex - pkg/timeoutconn - pkg/term - pkg/tarsum - pkg/tailfile - pkg/systemd - pkg/stringutils - pkg/stringid - pkg/streamformatter - pkg/sockets - pkg/signal - pkg/proxy - pkg/progressreader - pkg/pools - pkg/plugins - pkg/pidfile - pkg/parsers - pkg/parsers/filters - pkg/parsers/kernel - pkg/parsers/operatingsystem Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
a922d62168
commit
9bcb3cba83
56 changed files with 455 additions and 195 deletions
|
@ -1,3 +1,4 @@
|
|||
// Package timeoutconn provides overridden net.Conn that supports deadline (timeout).
|
||||
package timeoutconn
|
||||
|
||||
import (
|
||||
|
@ -5,11 +6,13 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// New creates a net.Conn with a timeout for every Read operation.
|
||||
func New(netConn net.Conn, timeout time.Duration) net.Conn {
|
||||
return &conn{netConn, timeout}
|
||||
}
|
||||
|
||||
// A net.Conn that sets a deadline for every Read or Write operation
|
||||
// A net.Conn that sets a deadline for every Read operation.
|
||||
// FIXME was documented the deadline was on Write operation too but not implement
|
||||
type conn struct {
|
||||
net.Conn
|
||||
timeout time.Duration
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue