Skip to content

Commit

Permalink
Fixes linting for golang v1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
thunef committed Oct 30, 2023
1 parent 7bbd09b commit 4f3dfa7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package config

import (
"io/ioutil"
"os"
"strconv"
"time"
Expand Down Expand Up @@ -150,7 +149,7 @@ func ReadConfig(filePath string) Config {
var config Config
// Read YML
log.Info("Reading YAML Configuration: " + filePath)
source, err := ioutil.ReadFile(filePath)
source, err := os.ReadFile(filePath)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/http/httpClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package http

import (
"bytes"
"io/ioutil"
"io"
"net/http"

logf "sigs.k8s.io/controller-runtime/pkg/log"
Expand Down Expand Up @@ -56,7 +56,7 @@ func (client *HttpClient) RequestWithHeaders(requestType string, body []byte, he
httpResponse := HttpResponse{StatusCode: response.StatusCode}

defer response.Body.Close()
responseBytes, _ := ioutil.ReadAll(response.Body)
responseBytes, _ := io.ReadAll(response.Body)
httpResponse.Bytes = responseBytes

return httpResponse
Expand Down
3 changes: 2 additions & 1 deletion pkg/monitors/gcloud/gcloud-monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import (
"google.golang.org/api/iterator"
"google.golang.org/api/option"
monitoredres "google.golang.org/genproto/googleapis/api/monitoredres"
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
//monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"

endpointmonitorv1alpha1 "github.com/stakater/IngressMonitorController/v2/api/v1alpha1"
"github.com/stakater/IngressMonitorController/v2/pkg/config"
Expand Down
5 changes: 2 additions & 3 deletions pkg/monitors/statuscake/statuscake-monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -372,7 +371,7 @@ func (service *StatusCakeMonitorService) Add(m models.Monitor) {
if resp.StatusCode == http.StatusCreated {
log.Info("Monitor Added: " + m.Name)
} else {
bodyBytes, err := ioutil.ReadAll(resp.Body)
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
log.Error(err, "Unable to read response")
os.Exit(1)
Expand Down Expand Up @@ -406,7 +405,7 @@ func (service *StatusCakeMonitorService) Update(m models.Monitor) {
if resp.StatusCode == http.StatusNoContent {
log.Info("Monitor Updated: " + m.ID + m.Name)
} else {
bodyBytes, err := ioutil.ReadAll(resp.Body)
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
log.Error(err, "Unable to read response")
os.Exit(1)
Expand Down

0 comments on commit 4f3dfa7

Please sign in to comment.