|
|
@@ -11,7 +11,7 @@ func hello(w gopher.ResponseWriter, r *gopher.Request) { |
|
|
|
w.WriteInfo("Hello World!") |
|
|
|
} |
|
|
|
|
|
|
|
func ExampleClient() { |
|
|
|
func ExampleGet() { |
|
|
|
res, err := gopher.Get("gopher://gopher.floodgap.com") |
|
|
|
if err != nil { |
|
|
|
log.Fatal(err) |
|
|
@@ -23,3 +23,9 @@ func ExampleServer() { |
|
|
|
gopher.HandleFunc("/hello", hello) |
|
|
|
log.Fatal(gopher.ListenAndServe("localhost:7000", nil)) |
|
|
|
} |
|
|
|
|
|
|
|
func ExampleFileServer() { |
|
|
|
gopher.Handle("/", gopher.FileServer(gopher.Dir("/tmp"))) |
|
|
|
|
|
|
|
log.Fatal(gopher.ListenAndServe("localhost:7000", nil)) |
|
|
|
} |