From a5a853e26b89a7d8148e2bdc8363f3e4f7b474fe Mon Sep 17 00:00:00 2001 From: James Mills Date: Wed, 14 Sep 2016 14:32:16 +1000 Subject: [PATCH] Use named suffixes for examples --- gopher_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gopher_test.go b/gopher_test.go index 271423a..b105c7a 100644 --- a/gopher_test.go +++ b/gopher_test.go @@ -11,7 +11,7 @@ func hello(w gopher.ResponseWriter, r *gopher.Request) { w.WriteInfo("Hello World!") } -func ExampleGet() { +func Example_client() { res, err := gopher.Get("gopher://gopher.floodgap.com") if err != nil { log.Fatal(err) @@ -19,13 +19,12 @@ func ExampleGet() { fmt.Print(res.Dir.ToText()) } -func ExampleServer() { +func Example_server() { gopher.HandleFunc("/hello", hello) log.Fatal(gopher.ListenAndServe("localhost:7000", nil)) } -func ExampleFileServer() { +func Example_fileserver() { gopher.Handle("/", gopher.FileServer(gopher.Dir("/tmp"))) - log.Fatal(gopher.ListenAndServe("localhost:7000", nil)) }