Skip to content

Commit

Permalink
fix(request): fix when queryParam is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
fnoopb authored and fnoopb committed Dec 5, 2022
1 parent de9518d commit 7a804df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion csb.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ func (c *CSBClient) Do(ctx context.Context, result interface{}) error {
req := c.client.R().SetContext(ctx).SetQueryParams(c.QueryParam).SetBodyBytes(requestBody)

// merge params
params := c.QueryParam
params := make(map[string]string)
if c.QueryParam != nil {
params = c.QueryParam
}
if c.FormParam != nil {
for k, v := range c.FormParam {
params[k] = v
Expand Down

0 comments on commit 7a804df

Please sign in to comment.