Skip to content

Commit ad60e84

Browse files
committed
Remove unused import and update BuildClient function signature
1 parent e9f4b00 commit ad60e84

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

httpclient/httpclient_client.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ like the baseURL, authentication details, and an embedded standard HTTP client.
88
package httpclient
99

1010
import (
11-
"log"
1211
"net/http"
1312
"sync"
1413
"time"
@@ -83,14 +82,7 @@ type PerformanceMetrics struct {
8382
}
8483

8584
// BuildClient creates a new HTTP client with the provided configuration.
86-
func BuildClient(configFilePath string) (*Client, error) {
87-
88-
// Load the configuration
89-
config, err := SetClientConfiguration(configFilePath)
90-
if err != nil {
91-
log.Printf("Failed to set client configuration: %v", err) // This uses the standard log package before zap logger is initialized
92-
return nil, err
93-
}
85+
func BuildClient(config ClientConfig) (*Client, error) {
9486

9587
// Parse the log level string to logger.LogLevel
9688
parsedLogLevel := logger.ParseLogLevelFromString(config.ClientOptions.LogLevel)
@@ -128,7 +120,7 @@ func BuildClient(configFilePath string) (*Client, error) {
128120
AuthMethod: authMethod,
129121
OverrideBaseDomain: config.Environment.OverrideBaseDomain,
130122
httpClient: &http.Client{Timeout: config.ClientOptions.CustomTimeout},
131-
clientConfig: *config,
123+
clientConfig: config,
132124
Logger: log,
133125
ConcurrencyMgr: NewConcurrencyManager(config.ClientOptions.MaxConcurrentRequests, log, true),
134126
PerfMetrics: PerformanceMetrics{},

0 commit comments

Comments
 (0)