development-ib-fork/web/07/mini_exercises/demo_helloworld.go

19 lines
289 B
Go

package main
import (
"fmt"
"net/http"
)
type helloHandler int
func (hello helloHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello World %d", hello)
}
func _main() {
var world helloHandler
world = 42
http.ListenAndServe("localhost:8080", world)
}