GoでWebプログラミングを学ぼうとしています。私は単純な「HelloWorld」Webサーバーをじっと見つめました。
package main
import "fmt"
import "net/http"
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello, world")
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}
そして私が行くとき
http://localhost:8080/handler
ブラウザでは、ブラウザは何も検出できないようで、何も起こりません。これの理由は何でしょうか?