Skip to content

Commit

Permalink
Change ClientResponse to accept an *http.Response (#3617)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias authored Jan 26, 2023
1 parent c0fb8de commit 604772d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/tools/semconvkit/templates/httpconv/http.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var (
// request contained in resp. For example:
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func ClientResponse(resp http.Response) []attribute.KeyValue {
func ClientResponse(resp *http.Response) []attribute.KeyValue {
return hc.ClientResponse(resp)
}

Expand Down
2 changes: 1 addition & 1 deletion semconv/internal/v2/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type HTTPConv struct {
// request contained in resp. For example:
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func (c *HTTPConv) ClientResponse(resp http.Response) []attribute.KeyValue {
func (c *HTTPConv) ClientResponse(resp *http.Response) []attribute.KeyValue {
var n int
if resp.StatusCode > 0 {
n++
Expand Down
2 changes: 1 addition & 1 deletion semconv/internal/v2/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var hc = &HTTPConv{

func TestHTTPClientResponse(t *testing.T) {
const stat, n = 201, 397
resp := http.Response{
resp := &http.Response{
StatusCode: stat,
ContentLength: n,
}
Expand Down
2 changes: 1 addition & 1 deletion semconv/v1.13.0/httpconv/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var (
// request contained in resp. For example:
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func ClientResponse(resp http.Response) []attribute.KeyValue {
func ClientResponse(resp *http.Response) []attribute.KeyValue {
return hc.ClientResponse(resp)
}

Expand Down
2 changes: 1 addition & 1 deletion semconv/v1.14.0/httpconv/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var (
// request contained in resp. For example:
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func ClientResponse(resp http.Response) []attribute.KeyValue {
func ClientResponse(resp *http.Response) []attribute.KeyValue {
return hc.ClientResponse(resp)
}

Expand Down
2 changes: 1 addition & 1 deletion semconv/v1.15.0/httpconv/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var (
// request contained in resp. For example:
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func ClientResponse(resp http.Response) []attribute.KeyValue {
func ClientResponse(resp *http.Response) []attribute.KeyValue {
return hc.ClientResponse(resp)
}

Expand Down
2 changes: 1 addition & 1 deletion semconv/v1.16.0/httpconv/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var (
// request contained in resp. For example:
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func ClientResponse(resp http.Response) []attribute.KeyValue {
func ClientResponse(resp *http.Response) []attribute.KeyValue {
return hc.ClientResponse(resp)
}

Expand Down
2 changes: 1 addition & 1 deletion semconv/v1.17.0/httpconv/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var (
// request contained in resp. For example:
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func ClientResponse(resp http.Response) []attribute.KeyValue {
func ClientResponse(resp *http.Response) []attribute.KeyValue {
return hc.ClientResponse(resp)
}

Expand Down

0 comments on commit 604772d

Please sign in to comment.