Skip to content

Commit

Permalink
Merge pull request #253 from testwill/loop
Browse files Browse the repository at this point in the history
chore: slice replace loop
  • Loading branch information
imroc authored Jul 12, 2023
2 parents e0bc46b + 9355c9b commit 580ebee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,7 @@ func parseRequestCookie(c *Client, r *Request) error {
if len(c.Cookies) == 0 {
return nil
}
for _, ck := range c.Cookies {
r.Cookies = append(r.Cookies, ck)
}
r.Cookies = append(r.Cookies, c.Cookies...)
return nil
}

Expand Down
8 changes: 2 additions & 6 deletions retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ func (ro *retryOption) Clone() *retryOption {
MaxRetries: ro.MaxRetries,
GetRetryInterval: ro.GetRetryInterval,
}
for _, c := range ro.RetryConditions {
o.RetryConditions = append(o.RetryConditions, c)
}
for _, h := range ro.RetryHooks {
o.RetryHooks = append(o.RetryHooks, h)
}
o.RetryConditions = append(o.RetryConditions, ro.RetryConditions...)
o.RetryHooks = append(o.RetryHooks, ro.RetryHooks...)
return o
}

0 comments on commit 580ebee

Please sign in to comment.