File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,8 @@ type service struct {
192
192
func (c * Client ) Client () * http.Client {
193
193
c .clientMu .Lock ()
194
194
defer c .clientMu .Unlock ()
195
- return c .client
195
+ clientCopy := * c .client
196
+ return & clientCopy
196
197
}
197
198
198
199
// ListOptions specifies the optional parameters to various List methods that
Original file line number Diff line number Diff line change @@ -235,8 +235,8 @@ func TestNewClient(t *testing.T) {
235
235
func TestClient (t * testing.T ) {
236
236
c := NewClient (nil )
237
237
c2 := c .Client ()
238
- if c .client ! = c2 {
239
- t .Error ("Client returned different http.Client, but should be the same. " )
238
+ if c .client = = c2 {
239
+ t .Error ("Client returned same http.Client, but should be different " )
240
240
}
241
241
}
242
242
You can’t perform that action at this time.
0 commit comments