From 2b957a3e7332c73794bed4286d744c142fc06218 Mon Sep 17 00:00:00 2001 From: Jaana Burcu Dogan Date: Tue, 4 Oct 2016 14:31:03 -0700 Subject: content/http-tracing: fix the OMIT tags Display only a small section of the trace.go example. Change-Id: I8fd1334a41324392f0c252a444b89e12955ab1fe Reviewed-on: https://go-review.googlesource.com/30351 Reviewed-by: Brad Fitzpatrick --- content/http-tracing.article | 2 +- content/http-tracing/client.go | 4 ---- content/http-tracing/trace.go | 2 +- 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 } -- cgit v1.2.3