diff --git a/network/client_test.go b/network/client_test.go index 7e7a42aa..91789295 100644 --- a/network/client_test.go +++ b/network/client_test.go @@ -118,7 +118,7 @@ func BenchmarkNewClient(b *testing.B) { logger := logging.NewLogger(context.Background(), cfg) for i := 0; i < b.N; i++ { - c := NewClient(context.Background(), &config.Client{ + client := NewClient(context.Background(), &config.Client{ Network: "tcp", Address: "localhost:5432", ReceiveChunkSize: config.DefaultChunkSize, @@ -127,7 +127,7 @@ func BenchmarkNewClient(b *testing.B) { TCPKeepAlive: false, TCPKeepAlivePeriod: config.DefaultTCPKeepAlivePeriod, }, logger) - c.Close() + client.Close() } } @@ -156,7 +156,7 @@ func BenchmarkSend(b *testing.B) { packet := CreatePgStartupPacket() for i := 0; i < b.N; i++ { - client.Send(packet) + client.Send(packet) //nolint:errcheck } } @@ -185,9 +185,9 @@ func BenchmarkReceive(b *testing.B) { defer client.Close() packet := CreatePgStartupPacket() - client.Send(packet) + client.Send(packet) //nolint:errcheck for i := 0; i < b.N; i++ { - client.Receive() + client.Receive() //nolint:errcheck } } diff --git a/network/proxy_test.go b/network/proxy_test.go index 1c4df577..770cada6 100644 --- a/network/proxy_test.go +++ b/network/proxy_test.go @@ -229,7 +229,7 @@ func BenchmarkProxyConnectDisconnect(b *testing.B) { TCPKeepAlive: false, TCPKeepAlivePeriod: config.DefaultTCPKeepAlivePeriod, } - pool.Put("client", NewClient(context.Background(), &clientConfig, logger)) + pool.Put("client", NewClient(context.Background(), &clientConfig, logger)) //nolint:errcheck // Create a proxy with a fixed buffer pool proxy := NewProxy( @@ -256,8 +256,8 @@ func BenchmarkProxyConnectDisconnect(b *testing.B) { // Connect to the proxy for i := 0; i < b.N; i++ { - proxy.Connect(gconn.Conn) - proxy.Disconnect(&gconn) + proxy.Connect(gconn.Conn) //nolint:errcheck + proxy.Disconnect(&gconn) //nolint:errcheck } } @@ -283,7 +283,7 @@ func BenchmarkProxyPassThrough(b *testing.B) { TCPKeepAlive: false, TCPKeepAlivePeriod: config.DefaultTCPKeepAlivePeriod, } - pool.Put("client", NewClient(context.Background(), &clientConfig, logger)) + pool.Put("client", NewClient(context.Background(), &clientConfig, logger)) //nolint:errcheck // Create a proxy with a fixed buffer pool proxy := NewProxy( @@ -307,12 +307,12 @@ func BenchmarkProxyPassThrough(b *testing.B) { defer proxy.Shutdown() gconn := testGNetConnection{} - proxy.Connect(gconn.Conn) - defer proxy.Disconnect(&gconn) + proxy.Connect(gconn.Conn) //nolint:errcheck + defer proxy.Disconnect(&gconn) //nolint:errcheck // Connect to the proxy for i := 0; i < b.N; i++ { - proxy.PassThrough(&gconn) + proxy.PassThrough(&gconn) //nolint:errcheck } } @@ -339,7 +339,7 @@ func BenchmarkProxyIsHealthyAndIsExhausted(b *testing.B) { TCPKeepAlivePeriod: config.DefaultTCPKeepAlivePeriod, } client := NewClient(context.Background(), &clientConfig, logger) - pool.Put("client", client) + pool.Put("client", client) //nolint:errcheck // Create a proxy with a fixed buffer pool proxy := NewProxy( @@ -363,12 +363,12 @@ func BenchmarkProxyIsHealthyAndIsExhausted(b *testing.B) { defer proxy.Shutdown() gconn := testGNetConnection{} - proxy.Connect(gconn.Conn) - defer proxy.Disconnect(&gconn) + proxy.Connect(gconn.Conn) //nolint:errcheck + defer proxy.Disconnect(&gconn) //nolint:errcheck // Connect to the proxy for i := 0; i < b.N; i++ { - proxy.IsHealty(client) + proxy.IsHealty(client) //nolint:errcheck proxy.IsExhausted() } } @@ -396,7 +396,7 @@ func BenchmarkProxyAvailableAndBusyConnections(b *testing.B) { TCPKeepAlivePeriod: config.DefaultTCPKeepAlivePeriod, } client := NewClient(context.Background(), &clientConfig, logger) - pool.Put("client", client) + pool.Put("client", client) //nolint:errcheck // Create a proxy with a fixed buffer pool proxy := NewProxy( @@ -420,8 +420,8 @@ func BenchmarkProxyAvailableAndBusyConnections(b *testing.B) { defer proxy.Shutdown() gconn := testGNetConnection{} - proxy.Connect(gconn.Conn) - defer proxy.Disconnect(&gconn) + proxy.Connect(gconn.Conn) //nolint:errcheck + defer proxy.Disconnect(&gconn) //nolint:errcheck // Connect to the proxy for i := 0; i < b.N; i++ { diff --git a/network/utils_test.go b/network/utils_test.go index 4ed397cc..2ab4f0d4 100644 --- a/network/utils_test.go +++ b/network/utils_test.go @@ -78,7 +78,7 @@ func BenchmarkResolveUDP(b *testing.B) { logger := logging.NewLogger(context.Background(), cfg) for i := 0; i < b.N; i++ { - Resolve("udp", "localhost:53", logger) + Resolve("udp", "localhost:53", logger) //nolint:errcheck } } @@ -93,7 +93,7 @@ func BenchmarkResolveTCP(b *testing.B) { logger := logging.NewLogger(context.Background(), cfg) for i := 0; i < b.N; i++ { - Resolve("tcp", "localhost:5432", logger) + Resolve("tcp", "localhost:5432", logger) //nolint:errcheck } } @@ -108,7 +108,7 @@ func BenchmarkResolveUnix(b *testing.B) { logger := logging.NewLogger(context.Background(), cfg) for i := 0; i < b.N; i++ { - Resolve("unix", "/tmp/unix.sock", logger) + Resolve("unix", "/tmp/unix.sock", logger) //nolint:errcheck } }