Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions rest/wazuh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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
}

Expand Down