I've investegated a way to mock HTTP request and response when writing a code to access to a HTTP API with http.Client. Finally, I found that I can do it by just implementing RoundTrip method of http.RoundTripper. Here is an example of mocking and proxying HTTP request and response. Running with go run main.go -mock mock, you can get mocked result and with go run main.go -mock proxy, you can get p
![Mocking a HTTP access with http.Transport in Golang - oinume journal](https://cdn-ak-scissors.b.st-hatena.com/image/square/f97f3e176605608155925eb3d06b7d35fe74fc89/height=288;version=1;width=512/http%3A%2F%2F1.bp.blogspot.com%2F-7Azzv9DtfKs%2FUhXEp6tTd_I%2FAAAAAAACLlY%2FEc6YLLENWxg%2Fs1600%2Fgopher.png)