Skip to content

Commit 89d1c0d

Browse files
committed
no need to initialised with one more variable
1 parent cbeb933 commit 89d1c0d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

config/confighttp/confighttp.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,11 @@ type ClientConfig struct {
108108
func NewDefaultClientConfig() ClientConfig {
109109
// The default values are taken from the values of 'DefaultTransport' of 'http' package.
110110

111-
// Configure with the non-nil map value.
112-
headers := make(map[string]configopaque.String)
113-
114111
maxIdleConns := 100
115112
idleConnTimeout := 90 * time.Second
116113

117114
return ClientConfig{
118-
Headers: headers,
115+
Headers: make(map[string]configopaque.String),
119116
MaxIdleConns: &maxIdleConns,
120117
IdleConnTimeout: &idleConnTimeout,
121118
}
@@ -293,11 +290,9 @@ type ServerConfig struct {
293290

294291
// NewDefaultServerConfig creates new ServerConfig with default values set
295292
func NewDefaultServerConfig() ServerConfig {
296-
// Create a new map for ResponseHeaders
297-
responseHeaders := make(map[string]configopaque.String)
298293

299294
return ServerConfig{
300-
ResponseHeaders: responseHeaders,
295+
ResponseHeaders: make(map[string]configopaque.String),
301296
}
302297
}
303298

0 commit comments

Comments
 (0)