FAQ
http.*HandleFunc*("/", handler)
not http.HandlerFunc("/", handler)
On Sunday, May 23, 2010 9:34:56 PM UTC+8, Kaoru wrote:

I'm going thru "Writing Web Applications" (http://golang.org/doc/
codelab/wiki/ <http://golang.org/doc/codelab/wiki/>). I typed in the
simple web server:

package main

import (
"fmt"
"http"
)

func handler(c *http.Conn, r *http.Request) {
fmt.Fprintf(c, "Hi there, I love %s!", r.URL.Path[1:])
}

func main() {
http.HandlerFunc("/", handler)
http.ListenAndServe(":8080", nil)
}

and tried to compile, but the got the following error:

simplewebserver.go:13: too many arguments to CALL

How do I correct this? 8g version is:

8g version 5440 release.2010-05-04 release

Thanks!
--

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 23, '12 at 1:32p
activeDec 23, '12 at 1:32p
posts1
users1
websitegolang.org

1 user in discussion

Yuncy: 1 post

People

Translate

site design / logo © 2022 Grokbase