|
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
|
|
http.ListenAndServe("localhost:8080", world)
|
|
}
|