aboutsummaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/http-tracing.article2
-rw-r--r--content/http-tracing/client.go4
-rw-r--r--content/http-tracing/trace.go2
3 files changed, 2 insertions, 6 deletions
diff --git a/content/http-tracing.article b/content/http-tracing.article
index 46fffbd..ae14d57 100644
--- a/content/http-tracing.article
+++ b/content/http-tracing.article
@@ -35,7 +35,7 @@ looking for context's `*httptrace.ClientTrace` and calling the relevant hook fun
The tracing is scoped to the request's context and users should
put a `*httptrace.ClientTrace` to the request context before they start a request.
-.code http-tracing/trace.go
+.code http-tracing/trace.go /START/,/END/
During a round trip, `http.DefaultTransport` will invoke each hook
as an event happens. The program above will print the DNS
diff --git a/content/http-tracing/client.go b/content/http-tracing/client.go
index cadfa0d..caef742 100644
--- a/content/http-tracing/client.go
+++ b/content/http-tracing/client.go
@@ -9,8 +9,6 @@ import (
"net/http/httptrace"
)
-// START OMIT
-
// transport is an http.RoundTripper that keeps track of the in-flight
// request and implements hooks to report HTTP tracing events.
type transport struct {
@@ -44,5 +42,3 @@ func main() {
log.Fatal(err)
}
}
-
-// STOP OMIT
diff --git a/content/http-tracing/trace.go b/content/http-tracing/trace.go
index 2d6d75e..9b050ac 100644
--- a/content/http-tracing/trace.go
+++ b/content/http-tracing/trace.go
@@ -24,5 +24,5 @@ func trace() {
if _, err := http.DefaultTransport.RoundTrip(req); err != nil {
log.Fatal(err)
}
- // STOP OMIT
+ // END OMIT
}