From df99089b9f50215bd12671168b92c4d776c1e722 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Sat, 4 Jan 2020 09:50:52 -0800 Subject: [PATCH] Rename to shorter context --- examples.txt | 2 +- .../context-in-http-servers.hash | 2 -- .../context.go} | 2 +- examples/context/context.hash | 2 ++ .../context.sh} | 0 public/{context-in-http-servers => context} | 14 +++++++------- public/http-servers | 4 ++-- public/index.html | 2 +- public/spawning-processes | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 examples/context-in-http-servers/context-in-http-servers.hash rename examples/{context-in-http-servers/context-in-http-servers.go => context/context.go} (96%) create mode 100644 examples/context/context.hash rename examples/{context-in-http-servers/context-in-http-servers.sh => context/context.sh} (100%) rename public/{context-in-http-servers => context} (87%) diff --git a/examples.txt b/examples.txt index aa3ce31..27b9df5 100644 --- a/examples.txt +++ b/examples.txt @@ -68,7 +68,7 @@ Command-Line Subcommands Environment Variables HTTP Clients HTTP Servers -Context in HTTP Servers +Context Spawning Processes Exec'ing Processes Signals diff --git a/examples/context-in-http-servers/context-in-http-servers.hash b/examples/context-in-http-servers/context-in-http-servers.hash deleted file mode 100644 index 8e46d00..0000000 --- a/examples/context-in-http-servers/context-in-http-servers.hash +++ /dev/null @@ -1,2 +0,0 @@ -50f0c85266d1f8f546242ce8f8caf27732e99dff -h1gVSe70R00 diff --git a/examples/context-in-http-servers/context-in-http-servers.go b/examples/context/context.go similarity index 96% rename from examples/context-in-http-servers/context-in-http-servers.go rename to examples/context/context.go index 364d463..0ad734c 100644 --- a/examples/context-in-http-servers/context-in-http-servers.go +++ b/examples/context/context.go @@ -25,7 +25,7 @@ func hello(w http.ResponseWriter, req *http.Request) { // `Done()` channel for a signal that we should cancel // the work and return as soon as possible. select { - case <-time.After(3 * time.Second): + case <-time.After(10 * time.Second): fmt.Fprintf(w, "hello\n") case <-ctx.Done(): err := ctx.Err() diff --git a/examples/context/context.hash b/examples/context/context.hash new file mode 100644 index 0000000..311c608 --- /dev/null +++ b/examples/context/context.hash @@ -0,0 +1,2 @@ +a899a68d131b0f8cf3ae846ef728877d2407d219 +9fUzFC2uyFk diff --git a/examples/context-in-http-servers/context-in-http-servers.sh b/examples/context/context.sh similarity index 100% rename from examples/context-in-http-servers/context-in-http-servers.sh rename to examples/context/context.sh diff --git a/public/context-in-http-servers b/public/context similarity index 87% rename from public/context-in-http-servers rename to public/context index 960de8d..52712e4 100644 --- a/public/context-in-http-servers +++ b/public/context @@ -2,7 +2,7 @@ - Go by Example: Context in HTTP Servers + Go by Example: Context -
-

Go by Example: Context in HTTP Servers

+
+

Go by Example: Context

@@ -34,7 +34,7 @@ controlling cancellation.

- +
package main
 
@@ -98,7 +98,7 @@ the work and return as soon as possible.

    select {
-    case <-time.After(3 * time.Second):
+    case <-time.After(10 * time.Second):
         fmt.Fprintf(w, "hello\n")
     case <-ctx.Done():
         err := ctx.Err()
@@ -184,12 +184,12 @@ cancellation.

diff --git a/public/http-servers b/public/http-servers index ee3c146..fdf740b 100644 --- a/public/http-servers +++ b/public/http-servers @@ -14,7 +14,7 @@ if (e.key == "ArrowRight") { - window.location.href = 'context-in-http-servers'; + window.location.href = 'context'; } } @@ -201,7 +201,7 @@ router we’ve just set up.

- Next example: Context in HTTP Servers. + Next example: Context.

  • HTTP Servers
  • -
  • Context in HTTP Servers
  • +
  • Context
  • Spawning Processes
  • diff --git a/public/spawning-processes b/public/spawning-processes index 748398a..ce76f92 100644 --- a/public/spawning-processes +++ b/public/spawning-processes @@ -9,7 +9,7 @@ onkeydown = (e) => { if (e.key == "ArrowLeft") { - window.location.href = 'context-in-http-servers'; + window.location.href = 'context'; }