all: fix golangci-lint(revive) warnings after 0c0ed61ce7

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6001
This commit is contained in:
Aliaksandr Valialkin
2024-04-02 23:16:24 +03:00
parent c3a72b6cdb
commit 918cccaddf
47 changed files with 976 additions and 970 deletions

View File

@@ -90,7 +90,7 @@ type RequestHandler func(w http.ResponseWriter, r *http.Request) bool
// See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
func Serve(addrs []string, useProxyProtocol *flagutil.ArrayBool, rh RequestHandler) {
if rh == nil {
rh = func(w http.ResponseWriter, r *http.Request) bool {
rh = func(_ http.ResponseWriter, _ *http.Request) bool {
return false
}
}
@@ -152,7 +152,7 @@ func serveWithListener(addr string, ln net.Listener, rh RequestHandler) {
ErrorLog: logger.StdErrorLogger(),
}
if *connTimeout > 0 {
s.s.ConnContext = func(ctx context.Context, c net.Conn) context.Context {
s.s.ConnContext = func(ctx context.Context, _ net.Conn) context.Context {
timeoutSec := connTimeout.Seconds()
// Add a jitter for connection timeout in order to prevent Thundering herd problem
// when all the connections are established at the same time.