feat: support baggage propagation in httpc (#2375)

* feat: support baggage propagation in httpc

* chore: use go 1.16

* chore: use go 1.16

* chore: use go ^1.16

* chore: remove deprecated
This commit is contained in:
Kevin Wan
2022-09-10 15:18:52 +08:00
committed by GitHub
parent 590d784800
commit d935c83a54
44 changed files with 141 additions and 154 deletions

View File

@@ -3,7 +3,6 @@ package handler
import (
"bytes"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
@@ -15,7 +14,7 @@ import (
)
func init() {
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
}
func TestLogHandler(t *testing.T) {
@@ -55,7 +54,7 @@ func TestLogHandlerVeryLong(t *testing.T) {
req := httptest.NewRequest(http.MethodPost, "http://localhost", &buf)
handler := LogHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
r.Context().Value(internal.LogContext).(*internal.LogCollector).Append("anything")
io.Copy(ioutil.Discard, r.Body)
io.Copy(io.Discard, r.Body)
w.Header().Set("X-Test", "test")
w.WriteHeader(http.StatusServiceUnavailable)
_, err := w.Write([]byte("content"))