aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaana Burcu Dogan <jbd@google.com>2016-10-04 14:31:03 -0700
committerJaana Burcu Dogan <jbd@google.com>2016-10-04 21:50:46 +0000
commit2b957a3e7332c73794bed4286d744c142fc06218 (patch)
tree495068c9e94ed85aa597c93fae8885267315980e
parent32dd9e50b19739d4d1ad1c3dc8ec119218f126f2 (diff)
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 <bradfitz@golang.org>
-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
}