github.com/gospider007/requests@v0.0.0-20240506025355-c73d46169a23/test/response/isNewConn_test.go (about) 1 package main 2 3 import ( 4 "testing" 5 6 "github.com/gospider007/requests" 7 ) 8 9 func TestDefaultClient(t *testing.T) { 10 for i := 0; i < 2; i++ { 11 resp, err := requests.Get(nil, "https://httpbin.org/anything") 12 if err != nil { 13 t.Error(err) 14 } 15 if i == 1 && resp.IsNewConn() { 16 t.Error("new conn error") 17 } 18 } 19 }