概要 この記事はQiita - Go6 Advent Calendar 2019の20日目の記事です。 GolangでHTTPサーバーを立てるコードの詳細を追ってコードリーディングします。 参考実装 コードリーディングしていく実装はこちら。 package main import ( "net/http" ) func main() { mux := http.NewServeMux() handler := new(HelloHandler) mux.Handle("/", handler) s := http.Server{ Addr: ":3000", Handler: mux, } s.ListenAndServe() } type HelloHandler struct{} func (h *HelloHandler) ServeHTTP(w http.ResponseWrite
![bmf-tech.com - GolangのHTTPサーバーのコードリーディング](https://cdn-ak-scissors.b.st-hatena.com/image/square/5996e4a659e179a95617005ca0b3a183da527172/height=288;version=1;width=512/http%3A%2F%2Fbmf-tech.com%2Fvendor%2Fbmftech%2Fimg%2Fheader.jpg)