Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhungus committed Sep 12, 2023
1 parent b0025fa commit 5f0692c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions pkg/scraper/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ package scraper
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"time"

"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -59,7 +60,7 @@ func (s *Scraper) Collect(ch chan<- prometheus.Metric) {
return
}

token, err := ioutil.ReadFile(s.tokenPath)
token, err := os.ReadFile(s.tokenPath)
if err != nil {
s.logger.Fatal("unable to load specified token", zap.String("file", s.tokenPath), zap.Error(err))
}
Expand Down Expand Up @@ -95,7 +96,7 @@ func (s *Scraper) Collect(ch chan<- prometheus.Metric) {
}

defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
s.errCnt++
ch <- prometheus.MustNewConstMetric(
Expand Down
4 changes: 2 additions & 2 deletions pkg/scraper/scraper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
package scraper

import (
"io/ioutil"
"os"
"testing"
"time"

Expand Down Expand Up @@ -59,7 +59,7 @@ func TestDecodingJson(t *testing.T) {
},
} {
t.Run(tc.Name, func(t *testing.T) {
ex, err := ioutil.ReadFile(tc.InputFile)
ex, err := os.ReadFile(tc.InputFile)
if err != nil {
t.Fatalf("failed to read test data %+v", err)
}
Expand Down

0 comments on commit 5f0692c

Please sign in to comment.