Closed
Description
What version of Go are you using (go version)?
1.10 (win10_x64)
go test, The results always appear cached.
I made an HTTP request, the result of the server return was changed, but the test results were old.
However, run test (cached) does not make HTTP requests
Unless, I modified the code in func Test_** (), the result is the latest
func Test_gotest_cached(t *testing.T) {
req := NewRequest()
resp, b_resp, e1 := req.Get("http://10.20.60.52:8080/help")
if e1 != nil {
t.Error(e1)
return
}
fmt.Println(string(b_resp), resp.Status)
}server code:
http.HandleFunc("/help", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("hello!"))
})go test -v -timeout 30s newpay_svc -run ^Test_gotest_cached$
"hello!" => "hello world!" , but the test results were old.
Metadata
Metadata
Assignees
Labels
No labels