Skip to content

Commit

Permalink
refactor: refactor status code assertion in timeout_test.go
Browse files Browse the repository at this point in the history
- Change in `timeout_test.go`: The assertion for the status code has been modified. Instead of directly comparing the status code, it now assigns the status code to a variable `code` and then compares it.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Nov 25, 2023
1 parent 09305e3 commit eab81f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ func TestWriter_Status(t *testing.T) {

// Close the response body
defer w.Result().Body.Close()
assert.Equal(t, http.StatusInternalServerError, w.Result().StatusCode)
code := w.Result().StatusCode

Check failure on line 135 in timeout_test.go

View workflow job for this annotation

GitHub Actions / lint

response body must be closed (bodyclose)
assert.Equal(t, http.StatusInternalServerError, code)
assert.Equal(t, strconv.Itoa(http.StatusInternalServerError), req.Header.Get("X-Status-Code-MW-Set"))
}

Expand Down

0 comments on commit eab81f0

Please sign in to comment.