Fix backend linter errors

This commit is contained in:
Alexander Zobnin
2023-08-30 12:48:38 +02:00
parent a536e6d8db
commit c06683cd37
12 changed files with 81 additions and 72 deletions

View File

@@ -2,7 +2,7 @@ package zabbixapi
import (
"bytes"
"io/ioutil"
"io"
"net/http"
"net/url"
@@ -36,7 +36,7 @@ func MockZabbixAPI(body string, statusCode int) (*ZabbixAPI, error) {
httpClient: NewTestClient(func(req *http.Request) *http.Response {
return &http.Response{
StatusCode: statusCode,
Body: ioutil.NopCloser(bytes.NewBufferString(body)),
Body: io.NopCloser(bytes.NewBufferString(body)),
Header: make(http.Header),
}
}),

View File

@@ -6,7 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -214,7 +214,7 @@ func makeHTTPRequest(ctx context.Context, httpClient *http.Client, req *http.Req
return nil, fmt.Errorf("request failed, status: %v", res.Status)
}
body, err := ioutil.ReadAll(res.Body)
body, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
}