1
0
gotour-notes/http-hello/server.go
2012-08-27 22:45:05 -06:00

20 lines
246 B
Go

package main
import (
"fmt"
"net/http"
)
type Hello struct{}
func (h Hello) ServeHTTP(
w http.ResponseWriter,
r *http.Request) {
fmt.Fprint(w, "Hello world")
}
func main() {
var h Hello
http.ListenAndServe("localhost:4000", h)
}