From 0db39e6622d01f82016bef8819da0f446b419e3d 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 0e9a562828f..2d01f3b1f6b 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -106,14 +106,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, } @@ -283,11 +280,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), } }