func TestSetsRemoteAddr(t *testing.T) { defer afterTest(t) ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) { fmt.Fprintf(w, "%s", r.RemoteAddr) })) defer ts.Close() res, err := Get(ts.URL) if err != nil { t.Fatalf("Get error: %v", err) } body, err := ioutil.ReadAll(res.Body) if err != nil { t.Fatalf("ReadAll error: %v", err) } ip := string(body) if !strings.HasPrefix(ip, "1