mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 14:14:02 +03:00
fix: address staticcheck lint issues
- avoid deprecated DefaultIdleTimeout, use time.Minute directly - simplify embedded field selectors (QF1008)
This commit is contained in:
+2
-2
@@ -104,13 +104,13 @@ type connIdleTimeout struct {
|
||||
}
|
||||
|
||||
func (c connIdleTimeout) Read(b []byte) (int, error) {
|
||||
c.Conn.SetReadDeadline(time.Now().Add(c.timeout)) //nolint: errcheck
|
||||
c.SetReadDeadline(time.Now().Add(c.timeout)) //nolint: errcheck
|
||||
|
||||
return c.Conn.Read(b) //nolint: wrapcheck
|
||||
}
|
||||
|
||||
func (c connIdleTimeout) Write(b []byte) (int, error) {
|
||||
c.Conn.SetWriteDeadline(time.Now().Add(c.timeout)) //nolint: errcheck
|
||||
c.SetWriteDeadline(time.Now().Add(c.timeout)) //nolint: errcheck
|
||||
|
||||
return c.Conn.Write(b) //nolint: wrapcheck
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ func (p ProxyOpts) getPreferIP() string {
|
||||
|
||||
func (p ProxyOpts) getIdleTimeout() time.Duration {
|
||||
if p.IdleTimeout == 0 {
|
||||
return DefaultIdleTimeout
|
||||
return time.Minute
|
||||
}
|
||||
|
||||
return p.IdleTimeout
|
||||
|
||||
Reference in New Issue
Block a user