Slide 22
Slide 22 text
HTTPサーバーのコードにdeep dive
• Mux(http.NewServeMux( ))は作らなくても良い。DefaultServeMuxを使うことができ
る。
• DefaultServeMuxはServeMux型の構造体を持っており、HandlerFuncというmuxにルー
ティングを登録する関数を実装している。
• cf.
• DefaultServeMux
• https://golang.org/src/net/http/server.go?s=77627:77714#L2269
• func (mux *ServeMux) HandlerFunc(pattern string, handler func(ResponseWriter, *Request))