box-o-sand/gotime/gotour-artifacts/hello-web/main.go

20 lines
237 B
Go
Raw Normal View History

package main
import (
2012-11-06 02:00:35 +00:00
"fmt"
"net/http"
)
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")
}
func main() {
2012-11-06 02:00:35 +00:00
var h Hello
http.ListenAndServe("localhost:4000", h)
}