]> Cypherpunks repositories - gostls13.git/commitdiff
http: fix documentation example
authorRuss Cox <rsc@golang.org>
Tue, 6 Apr 2010 05:55:05 +0000 (22:55 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 6 Apr 2010 05:55:05 +0000 (22:55 -0700)
R=adg
CC=golang-dev
https://golang.org/cl/813043

src/pkg/http/server.go

index bd1d0a703fd227a93af377952122d81c5348790b..a28eb25ee4a60a16a66393f08f2caad75eec9363 100644 (file)
@@ -571,20 +571,21 @@ func Serve(l net.Listener, handler Handler) os.Error {
 //     package main
 //
 //     import (
-//             "http";
-//             "io";
+//             "http"
+//             "io"
+//             "log"
 //     )
 //
 //     // hello world, the web server
 //     func HelloServer(c *http.Conn, req *http.Request) {
-//             io.WriteString(c, "hello, world!\n");
+//             io.WriteString(c, "hello, world!\n")
 //     }
 //
 //     func main() {
-//             http.Handle("/hello", http.HandlerFunc(HelloServer));
-//             err := http.ListenAndServe(":12345", nil);
+//             http.HandleFunc("/hello", HelloServer)
+//             err := http.ListenAndServe(":12345", nil)
 //             if err != nil {
-//                     panic("ListenAndServe: ", err.String())
+//                     log.Exit("ListenAndServe: ", err.String())
 //             }
 //     }
 func ListenAndServe(addr string, handler Handler) os.Error {