Commit a267ff6a authored by Russ Cox's avatar Russ Cox

http: fix documentation example

R=adg
CC=golang-dev
https://golang.org/cl/813043
parent edcd70e0
...@@ -571,20 +571,21 @@ func Serve(l net.Listener, handler Handler) os.Error { ...@@ -571,20 +571,21 @@ func Serve(l net.Listener, handler Handler) os.Error {
// package main // package main
// //
// import ( // import (
// "http"; // "http"
// "io"; // "io"
// "log"
// ) // )
// //
// // hello world, the web server // // hello world, the web server
// func HelloServer(c *http.Conn, req *http.Request) { // func HelloServer(c *http.Conn, req *http.Request) {
// io.WriteString(c, "hello, world!\n"); // io.WriteString(c, "hello, world!\n")
// } // }
// //
// func main() { // func main() {
// http.Handle("/hello", http.HandlerFunc(HelloServer)); // http.HandleFunc("/hello", HelloServer)
// err := http.ListenAndServe(":12345", nil); // err := http.ListenAndServe(":12345", nil)
// if err != nil { // if err != nil {
// panic("ListenAndServe: ", err.String()) // log.Exit("ListenAndServe: ", err.String())
// } // }
// } // }
func ListenAndServe(addr string, handler Handler) os.Error { func ListenAndServe(addr string, handler Handler) os.Error {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment