こんにちは、@ono_matopeです。 GoでHTTPサーバを開発する際、通常はlocalhostで適当にサーバを起動し、 など、ホスト名にローカルアドレスを指定したHTTPリクエストを発行してテストをしていることと思います。(net/http/httptestを使った場合も基本的には同じ) ですが、例えば http://matope.github.com のように、URLホスト名の一部がパラメータであるなどの理由によって、localhost以外のホスト名でHTTPサーバをテストしなければいけないことがあります。こんな時にどうしてますか?hosts? dnsmasq? つらいですね。 実はGoであれば、ほんの少しのコード追加で、ローカルのサーバーに任意のホスト名でHTTPリクエストを発行することができます。 new_addr := "localhost:8080" var localDi