1// A small test program that uses the net/http package. There is 2// nothing special about net/http here, this is just a convenient way 3// to pull in a lot of code. 4 5package main 6 7import ( 8 "net/http" 9 "net/http/httptest" 10) 11 12type statusHandler int 13 14func (h *statusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 15 w.WriteHeader(int(*h)) 16} 17 18func main() { 19 status := statusHandler(http.StatusNotFound) 20 s := httptest.NewServer(&status) 21 defer s.Close() 22} 23