From 89d1c0d239bf1f9f957c77efd227b6518c221696 Mon Sep 17 00:00:00 2001 From: Sanket Date: Mon, 11 Mar 2024 16:46:11 +0530 Subject: [PATCH] no need to initialised with one more variable --- config/confighttp/confighttp.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go index 4126fc86ed2..c2ded2684d9 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -108,14 +108,11 @@ type ClientConfig struct { func NewDefaultClientConfig() ClientConfig { // The default values are taken from the values of 'DefaultTransport' of 'http' package. - // Configure with the non-nil map value. - headers := make(map[string]configopaque.String) - maxIdleConns := 100 idleConnTimeout := 90 * time.Second return ClientConfig{ - Headers: headers, + Headers: make(map[string]configopaque.String), MaxIdleConns: &maxIdleConns, IdleConnTimeout: &idleConnTimeout, } @@ -293,11 +290,9 @@ type ServerConfig struct { // NewDefaultServerConfig creates new ServerConfig with default values set func NewDefaultServerConfig() ServerConfig { - // Create a new map for ResponseHeaders - responseHeaders := make(map[string]configopaque.String) return ServerConfig{ - ResponseHeaders: responseHeaders, + ResponseHeaders: make(map[string]configopaque.String), } }