2012-10-18 13:17:47 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2012-11-06 02:00:35 +00:00
|
|
|
"fmt"
|
|
|
|
"net/http"
|
2012-10-18 13:17:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Hello struct{}
|
|
|
|
|
|
|
|
func (h Hello) ServeHTTP(
|
2012-11-06 02:00:35 +00:00
|
|
|
w http.ResponseWriter,
|
|
|
|
r *http.Request) {
|
|
|
|
fmt.Fprint(w, "Hello!\n")
|
2012-10-18 13:17:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2012-11-06 02:00:35 +00:00
|
|
|
var h Hello
|
|
|
|
http.ListenAndServe("localhost:4000", h)
|
2012-10-18 13:17:47 +00:00
|
|
|
}
|