mirror of
https://github.com/golang/go
synced 2024-11-24 22:00:09 -07:00
http: fix documentation example
R=adg CC=golang-dev https://golang.org/cl/813043
This commit is contained in:
parent
edcd70e07a
commit
a267ff6a81
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user