diff options
author | Jaana Burcu Dogan <jbd@google.com> | 2016-09-19 20:36:45 -0700 |
---|---|---|
committer | Jaana Burcu Dogan <jbd@google.com> | 2016-09-20 05:11:45 +0000 |
commit | f964810025ae58b623798a1944c39c06266fb45d (patch) | |
tree | d5c01ca1044860693e4d7c7bef708a984ac75918 | |
parent | 836a3ae6639c310e1a13834c1f8f84bb982d920d (diff) | |
download | go-git-f964810025ae58b623798a1944c39c06266fb45d.tar.gz |
net/http/httptrace: fix bad tracing example
Tracing happens at the http.Trace level. Fix the example to demostrate
tracing in the lifecycle of a RoundTrip.
Updates #17152.
Change-Id: Ic7d7bcc550176189206185482e8962dbf1504ff1
Reviewed-on: https://go-review.googlesource.com/29431
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
-rw-r--r-- | src/net/http/httptrace/example_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/net/http/httptrace/example_test.go b/src/net/http/httptrace/example_test.go index 3a4b35469c..07fdc0a472 100644 --- a/src/net/http/httptrace/example_test.go +++ b/src/net/http/httptrace/example_test.go @@ -6,6 +6,7 @@ package httptrace_test import ( "fmt" + "log" "net/http" "net/http/httptrace" ) @@ -21,5 +22,8 @@ func Example() { }, } req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace)) - http.DefaultClient.Do(req) + _, err := http.DefaultTransport.RoundTrip(req) + if err != nil { + log.Fatal(err) + } } |