1package main
2
3import (
4 "fmt"
5 "log"
6 "net/http"
7)
8
9func handler(w http.ResponseWriter, r *http.Request) {
10 fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
11}
12
13func main() {
14 http.HandleFunc("/", handler)
15 log.Fatal(http.ListenAndServe(":8080", nil))
16}