diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
commit | 3e45412327a2654a77944249962b3652e6142299 (patch) | |
tree | bc3bf69452afa055423cbe0c5cfa8ca357df6ccf /doc/codelab/wiki/notemplate.go | |
parent | c533680039762cacbc37db8dc7eed074c3e497be (diff) | |
download | golang-upstream/2011.01.12.tar.gz |
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'doc/codelab/wiki/notemplate.go')
-rw-r--r-- | doc/codelab/wiki/notemplate.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/codelab/wiki/notemplate.go b/doc/codelab/wiki/notemplate.go index a61d905e3..c1f952c83 100644 --- a/doc/codelab/wiki/notemplate.go +++ b/doc/codelab/wiki/notemplate.go @@ -28,19 +28,19 @@ func loadPage(title string) (*page, os.Error) { const lenPath = len("/view/") -func viewHandler(c *http.Conn, r *http.Request) { +func viewHandler(w http.ResponseWriter, r *http.Request) { title := r.URL.Path[lenPath:] p, _ := loadPage(title) - fmt.Fprintf(c, "<h1>%s</h1><div>%s</div>", p.title, p.body) + fmt.Fprintf(w, "<h1>%s</h1><div>%s</div>", p.title, p.body) } -func editHandler(c *http.Conn, r *http.Request) { +func editHandler(w http.ResponseWriter, r *http.Request) { title := r.URL.Path[lenPath:] p, err := loadPage(title) if err != nil { p = &page{title: title} } - fmt.Fprintf(c, "<h1>Editing %s</h1>"+ + fmt.Fprintf(w, "<h1>Editing %s</h1>"+ "<form action=\"/save/%s\" method=\"POST\">"+ "<textarea name=\"body\">%s</textarea><br>"+ "<input type=\"submit\" value=\"Save\">"+ |