Skip to content

Commit cc78578

Browse files
authored
Fix ioutil deprecation (#146)
1 parent 0b42852 commit cc78578

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/vulnerability-db-rstats/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Copyright 2020 Adevinta
55
package main
66

77
import (
8-
"io/ioutil"
8+
"io"
99
"os"
1010

1111
log "github.com/sirupsen/logrus"
@@ -39,7 +39,7 @@ func parseConfig(cfgFilePath string) (*config, error) {
3939
}
4040
defer cfgFile.Close()
4141

42-
cfgData, err := ioutil.ReadAll(cfgFile)
42+
cfgData, err := io.ReadAll(cfgFile)
4343

4444
var conf config
4545
if _, err := toml.Decode(string(cfgData[:]), &conf); err != nil {

pkg/results/client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package results
77
import (
88
"errors"
99
"fmt"
10-
"io/ioutil"
10+
"io"
1111
"net/http"
1212

1313
report "github.com/adevinta/vulcan-report"
@@ -57,7 +57,7 @@ func (c *reportClient) Download(reportURL string) (report.Report, error) {
5757
return report.Report{}, ErrInvalidRespStatus
5858
}
5959

60-
body, err := ioutil.ReadAll(resp.Body)
60+
body, err := io.ReadAll(resp.Body)
6161
if err != nil {
6262
return report.Report{}, err
6363
}

0 commit comments

Comments
 (0)