Skip to content

Commit

Permalink
Add explicit setup of lock values
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiante committed Mar 3, 2024
1 parent 18b3ca4 commit 4b78f4e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client.go
Expand Up @@ -1137,6 +1137,10 @@ func (c *Client) GetClient() *http.Client {
func (c *Client) Clone() *Client {
// dereference the pointer and copy the value
cc := *c

// lock values should not be copied - thus new values are used.
cc.afterResponseLock = &sync.RWMutex{}
cc.udBeforeRequestLock = &sync.RWMutex{}
return &cc
}

Expand Down

0 comments on commit 4b78f4e

Please sign in to comment.