Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: lance6716 <lance6716@gmail.com>
  • Loading branch information
lance6716 committed Oct 25, 2023
1 parent 8a79799 commit 9f7fc9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 5 additions & 2 deletions br/pkg/pdutil/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,13 @@ func pdRequestWithCode(
return 0, nil, errors.Trace(err)
}
reqURL := fmt.Sprintf("%s/%s", u, prefix)
var resp *http.Response
var (
req *http.Request
resp *http.Response
)
count := 0
for {
req, err := http.NewRequestWithContext(ctx, method, reqURL, body)
req, err = http.NewRequestWithContext(ctx, method, reqURL, body)
if err != nil {
return 0, nil, errors.Trace(err)
}
Expand Down
2 changes: 0 additions & 2 deletions br/pkg/pdutil/pd_serial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ func TestPDRequestRetry(t *testing.T) {
body := bytes.NewBuffer([]byte("test"))
_, reqErr := pdRequest(ctx, taddr, "", cli, http.MethodPost, body)
require.NoError(t, reqErr)

ts.Close()
count = 0
ts = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -207,7 +206,6 @@ func TestPDRequestRetry(t *testing.T) {
w.WriteHeader(http.StatusGatewayTimeout)
return
}

w.WriteHeader(http.StatusOK)
}))
taddr = ts.URL
Expand Down

0 comments on commit 9f7fc9c

Please sign in to comment.