看了一下,发现好像就httptest下面的NewRequest方法多了这句话
```
req.RemoteAddr = "192.0.2.1:1234"
```
别的还有什么区别吗?
http的NewRequest方法地址:Golang/src/net/http/request.go,line765<br/>
httptest的NewRequest方法地址:/Golang/src/net/http/httptest/httptest.go,line41
有疑问加站长微信联系(非本文作者)