@@ -42,15 +42,15 @@ func GetRequestWithHeaders(url string, headers map[string]string) ([]byte, error
42
42
// GetRequest defines a wrapper around an HTTP GET request with a provided URL.
43
43
// An error is returned if the request or reading the body fails.
44
44
func GetRequest (url string ) ([]byte , error ) {
45
- res , err := http .Get (url )
45
+ resp , err := http .Get (url )
46
46
if err != nil {
47
47
return nil , err
48
48
}
49
49
defer func () {
50
- _ = res .Body .Close ()
50
+ _ = resp .Body .Close ()
51
51
}()
52
52
53
- body , err := io .ReadAll (res .Body )
53
+ body , err := io .ReadAll (resp .Body )
54
54
if err != nil {
55
55
return nil , err
56
56
}
@@ -61,15 +61,15 @@ func GetRequest(url string) ([]byte, error) {
61
61
// PostRequest defines a wrapper around an HTTP POST request with a provided URL and data.
62
62
// An error is returned if the request or reading the body fails.
63
63
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 ))
65
65
if err != nil {
66
66
return nil , fmt .Errorf ("error while sending post request: %w" , err )
67
67
}
68
68
defer func () {
69
- _ = res .Body .Close ()
69
+ _ = resp .Body .Close ()
70
70
}()
71
71
72
- bz , err := io .ReadAll (res .Body )
72
+ bz , err := io .ReadAll (resp .Body )
73
73
if err != nil {
74
74
return nil , fmt .Errorf ("error reading response body: %w" , err )
75
75
}
0 commit comments