Skip to content

Commit f611150

Browse files
chore: fix the gci lint issue in testutil (#21695)
1 parent 4c7cc86 commit f611150

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

testutil/rest.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ func GetRequestWithHeaders(url string, headers map[string]string) ([]byte, error
4242
// GetRequest defines a wrapper around an HTTP GET request with a provided URL.
4343
// An error is returned if the request or reading the body fails.
4444
func GetRequest(url string) ([]byte, error) {
45-
res, err := http.Get(url)
45+
resp, err := http.Get(url)
4646
if err != nil {
4747
return nil, err
4848
}
4949
defer func() {
50-
_ = res.Body.Close()
50+
_ = resp.Body.Close()
5151
}()
5252

53-
body, err := io.ReadAll(res.Body)
53+
body, err := io.ReadAll(resp.Body)
5454
if err != nil {
5555
return nil, err
5656
}
@@ -61,15 +61,15 @@ func GetRequest(url string) ([]byte, error) {
6161
// PostRequest defines a wrapper around an HTTP POST request with a provided URL and data.
6262
// An error is returned if the request or reading the body fails.
6363
func PostRequest(url, contentType string, data []byte) ([]byte, error) {
64-
res, err := http.Post(url, contentType, bytes.NewBuffer(data))
64+
resp, err := http.Post(url, contentType, bytes.NewBuffer(data))
6565
if err != nil {
6666
return nil, fmt.Errorf("error while sending post request: %w", err)
6767
}
6868
defer func() {
69-
_ = res.Body.Close()
69+
_ = resp.Body.Close()
7070
}()
7171

72-
bz, err := io.ReadAll(res.Body)
72+
bz, err := io.ReadAll(resp.Body)
7373
if err != nil {
7474
return nil, fmt.Errorf("error reading response body: %w", err)
7575
}

0 commit comments

Comments
 (0)