From 604772dda3b471b095992e22b27bbb3677fbfac6 Mon Sep 17 00:00:00 2001
From: Tyler Yahn
Date: Thu, 26 Jan 2023 09:21:55 -0800
Subject: [PATCH] Change ClientResponse to accept an *http.Response (#3617)
---
internal/tools/semconvkit/templates/httpconv/http.go.tmpl | 2 +-
semconv/internal/v2/http.go | 2 +-
semconv/internal/v2/http_test.go | 2 +-
semconv/v1.13.0/httpconv/http.go | 2 +-
semconv/v1.14.0/httpconv/http.go | 2 +-
semconv/v1.15.0/httpconv/http.go | 2 +-
semconv/v1.16.0/httpconv/http.go | 2 +-
semconv/v1.17.0/httpconv/http.go | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/internal/tools/semconvkit/templates/httpconv/http.go.tmpl b/internal/tools/semconvkit/templates/httpconv/http.go.tmpl
index 4d9244aa02d..f43ad8c1f3a 100644
--- a/internal/tools/semconvkit/templates/httpconv/http.go.tmpl
+++ b/internal/tools/semconvkit/templates/httpconv/http.go.tmpl
@@ -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)
}
diff --git a/semconv/internal/v2/http.go b/semconv/internal/v2/http.go
index 0f84a905b04..c93d768f4ee 100644
--- a/semconv/internal/v2/http.go
+++ b/semconv/internal/v2/http.go
@@ -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++
diff --git a/semconv/internal/v2/http_test.go b/semconv/internal/v2/http_test.go
index 73b9aa9b147..5a6686dd70c 100644
--- a/semconv/internal/v2/http_test.go
+++ b/semconv/internal/v2/http_test.go
@@ -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,
}
diff --git a/semconv/v1.13.0/httpconv/http.go b/semconv/v1.13.0/httpconv/http.go
index 9ba94c9e1e1..6e5bf4adb50 100644
--- a/semconv/v1.13.0/httpconv/http.go
+++ b/semconv/v1.13.0/httpconv/http.go
@@ -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)
}
diff --git a/semconv/v1.14.0/httpconv/http.go b/semconv/v1.14.0/httpconv/http.go
index 57dca5501b4..1ce725a237c 100644
--- a/semconv/v1.14.0/httpconv/http.go
+++ b/semconv/v1.14.0/httpconv/http.go
@@ -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)
}
diff --git a/semconv/v1.15.0/httpconv/http.go b/semconv/v1.15.0/httpconv/http.go
index 1b682db10b6..3c0d19a7053 100644
--- a/semconv/v1.15.0/httpconv/http.go
+++ b/semconv/v1.15.0/httpconv/http.go
@@ -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)
}
diff --git a/semconv/v1.16.0/httpconv/http.go b/semconv/v1.16.0/httpconv/http.go
index 218ac703c2c..77130fc35b7 100644
--- a/semconv/v1.16.0/httpconv/http.go
+++ b/semconv/v1.16.0/httpconv/http.go
@@ -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)
}
diff --git a/semconv/v1.17.0/httpconv/http.go b/semconv/v1.17.0/httpconv/http.go
index 7499accfb61..f4c6fe6a49a 100644
--- a/semconv/v1.17.0/httpconv/http.go
+++ b/semconv/v1.17.0/httpconv/http.go
@@ -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)
}