Skip to content

Commit

Permalink
tests: make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
pires committed Mar 15, 2023
1 parent fa4d9e8 commit 15e863f
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 77 deletions.
8 changes: 6 additions & 2 deletions protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ func (p *Conn) readHeader() error {
// run on the connection, as we don't want to override the previous
// read deadline the user may have used.
if p.readHeaderTimeout > 0 {
p.conn.SetReadDeadline(time.Now().Add(p.readHeaderTimeout))
if err := p.conn.SetReadDeadline(time.Now().Add(p.readHeaderTimeout)); err != nil {
return err
}
}

header, err := Read(p.bufReader)
Expand All @@ -259,7 +261,9 @@ func (p *Conn) readHeader() error {
if t == nil {
t = time.Time{}
}
p.conn.SetReadDeadline(t.(time.Time))
if err := p.conn.SetReadDeadline(t.(time.Time)); err != nil {
return err
}
if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
err = ErrNoProxyProtocol
}
Expand Down
Loading

0 comments on commit 15e863f

Please sign in to comment.