Skip to content

Commit

Permalink
Data race: Use a copy instead of a pointer to url.URL (#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
kannappanr authored Jun 21, 2019
1 parent f389a72 commit bb942b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bucket-cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (c Client) getBucketLocationRequest(bucketName string) (*http.Request, erro
urlValues.Set("location", "")

// Set get bucket location always as path style.
targetURL := c.endpointURL
targetURL := *c.endpointURL

// as it works in makeTargetURL method from api.go file
if h, p, err := net.SplitHostPort(targetURL.Host); err == nil {
Expand Down
2 changes: 1 addition & 1 deletion bucket-cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestGetBucketLocationRequest(t *testing.T) {
urlValues.Set("location", "")

// Set get bucket location always as path style.
targetURL := c.endpointURL
targetURL := *c.endpointURL
targetURL.Path = path.Join(bucketName, "") + "/"
targetURL.RawQuery = urlValues.Encode()

Expand Down

0 comments on commit bb942b2

Please sign in to comment.