ci: remove duplicate gosec & lint fixes (backport #21685) (#21686)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot]
2024-09-12 15:15:53 +02:00
committed by GitHub
co-authored by Julien Robert
parent 1ff55a78be
commit b88a473dcd
6 changed files with 27 additions and 99 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ func GetRequestWithHeaders(url string, headers map[string]string) ([]byte, error
// GetRequest defines a wrapper around an HTTP GET request with a provided URL.
// An error is returned if the request or reading the body fails.
func GetRequest(url string) ([]byte, error) {
res, err := http.Get(url) //nolint:gosec // only used for testing
res, err := http.Get(url)
if err != nil {
return nil, err
}
@@ -61,7 +61,7 @@ func GetRequest(url string) ([]byte, error) {
// PostRequest defines a wrapper around an HTTP POST request with a provided URL and data.
// An error is returned if the request or reading the body fails.
func PostRequest(url, contentType string, data []byte) ([]byte, error) {
res, err := http.Post(url, contentType, bytes.NewBuffer(data)) //nolint:gosec // only used for testing
res, err := http.Post(url, contentType, bytes.NewBuffer(data))
if err != nil {
return nil, fmt.Errorf("error while sending post request: %w", err)
}