You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
237 B
20 lines
237 B
12 years ago
|
package main
|
||
|
|
||
|
import (
|
||
12 years ago
|
"fmt"
|
||
|
"net/http"
|
||
12 years ago
|
)
|
||
|
|
||
|
type Hello struct{}
|
||
|
|
||
|
func (h Hello) ServeHTTP(
|
||
12 years ago
|
w http.ResponseWriter,
|
||
|
r *http.Request) {
|
||
|
fmt.Fprint(w, "Hello!\n")
|
||
12 years ago
|
}
|
||
|
|
||
|
func main() {
|
||
12 years ago
|
var h Hello
|
||
|
http.ListenAndServe("localhost:4000", h)
|
||
12 years ago
|
}
|