From fc5f73d6df6045fae3eb9d8b856d42b85c112aa8 Mon Sep 17 00:00:00 2001 From: Power Li Date: Tue, 7 Jan 2025 16:17:22 +0800 Subject: [PATCH] fix WithHTTPClient useless --- rest/wazuh.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rest/wazuh.go b/rest/wazuh.go index dbe028f..b99334b 100644 --- a/rest/wazuh.go +++ b/rest/wazuh.go @@ -269,13 +269,6 @@ func NewClient(baseURL string, opts ...ClientOption) (*Client, error) { userAgent: "go-wazuh", } - // mutate client and add all optional params - for _, o := range opts { - if err := o(c); err != nil { - return nil, err - } - } - if c.ctx == nil { c.ctx = context.Background() } @@ -303,6 +296,13 @@ func NewClient(baseURL string, opts ...ClientOption) (*Client, error) { Transport: &t, } + // mutate client and add all optional params + for _, o := range opts { + if err := o(c); err != nil { + return nil, err + } + } + return c, nil }