From ebd569961dbc1f8265c56ef9db6ef3bc84b9bfd3 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Sat, 20 Jun 2015 14:28:18 +0200 Subject: [PATCH] Remove dead code Signed-off-by: Antonio Murdaca --- docs/registry.go | 24 ------------------------ docs/registry_test.go | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/registry.go b/docs/registry.go index 80d4268e..8b78af96 100644 --- a/docs/registry.go +++ b/docs/registry.go @@ -8,7 +8,6 @@ import ( "io/ioutil" "net" "net/http" - "net/http/httputil" "os" "path" "path/filepath" @@ -200,29 +199,6 @@ func DockerHeaders(metaHeaders http.Header) []transport.RequestModifier { return modifiers } -type debugTransport struct { - http.RoundTripper - log func(...interface{}) -} - -func (tr debugTransport) RoundTrip(req *http.Request) (*http.Response, error) { - dump, err := httputil.DumpRequestOut(req, false) - if err != nil { - tr.log("could not dump request") - } - tr.log(string(dump)) - resp, err := tr.RoundTripper.RoundTrip(req) - if err != nil { - return nil, err - } - dump, err = httputil.DumpResponse(resp, false) - if err != nil { - tr.log("could not dump response") - } - tr.log(string(dump)) - return resp, err -} - func HTTPClient(transport http.RoundTripper) *http.Client { if transport == nil { transport = NewTransport(ConnectTimeout, true) diff --git a/docs/registry_test.go b/docs/registry_test.go index a6bd7201..7233075b 100644 --- a/docs/registry_test.go +++ b/docs/registry_test.go @@ -3,6 +3,7 @@ package registry import ( "fmt" "net/http" + "net/http/httputil" "net/url" "strings" "testing" @@ -911,3 +912,26 @@ func TestIsSecureIndex(t *testing.T) { } } } + +type debugTransport struct { + http.RoundTripper + log func(...interface{}) +} + +func (tr debugTransport) RoundTrip(req *http.Request) (*http.Response, error) { + dump, err := httputil.DumpRequestOut(req, false) + if err != nil { + tr.log("could not dump request") + } + tr.log(string(dump)) + resp, err := tr.RoundTripper.RoundTrip(req) + if err != nil { + return nil, err + } + dump, err = httputil.DumpResponse(resp, false) + if err != nil { + tr.log("could not dump response") + } + tr.log(string(dump)) + return resp, err +}