Skip to content

Commit d758174

Browse files
authored
fix deplicated io/ioutils | golang/go#40025 (#90)
Co-authored-by: whonion <[email protected]>
1 parent 3712a1b commit d758174

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cmd/cmd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ package cmd
1515

1616
import (
1717
"fmt"
18-
"io/ioutil"
18+
"io"
1919
"os"
2020

2121
"github.com/spf13/cobra"
@@ -126,9 +126,9 @@ func addHumanFlag(flags *pflag.FlagSet) {
126126
// the data is read from stdin.
127127
func ReadFile(filename string) ([]byte, error) {
128128
if filename == "-" {
129-
return ioutil.ReadAll(os.Stdin)
129+
return io.ReadAll(os.Stdin)
130130
}
131-
return ioutil.ReadFile(filename)
131+
return os.ReadFile(filename)
132132
}
133133

134134
// NewAPIClient returns a new utils.APIClient.

cmd/monitor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package cmd
1616
import (
1717
"errors"
1818
"fmt"
19-
"io/ioutil"
19+
"io"
2020
"os"
2121
"path"
2222
"path/filepath"
@@ -187,7 +187,7 @@ func NewMonitorItemsSetDetailsCmd() *cobra.Command {
187187
if len(args) == 0 {
188188
return errors.New("No item provided")
189189
} else if len(args) == 1 {
190-
detailsBytes, err := ioutil.ReadAll(os.Stdin)
190+
detailsBytes, err := io.ReadAll(os.Stdin)
191191
details = string(detailsBytes)
192192
if err != nil {
193193
return err

cmd/retrohunt.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package cmd
1616
import (
1717
"fmt"
1818
"github.com/VirusTotal/vt-cli/utils"
19-
"io/ioutil"
19+
"io"
2020
"os"
2121
"regexp"
2222
"strings"
@@ -165,9 +165,9 @@ func NewRetrohuntStartCmd() *cobra.Command {
165165

166166
var rules []byte
167167
if args[0] == "-" {
168-
rules, err = ioutil.ReadAll(os.Stdin)
168+
rules, err = io.ReadAll(os.Stdin)
169169
} else {
170-
rules, err = ioutil.ReadFile(args[0])
170+
rules, err = os.ReadFile(args[0])
171171
}
172172
if err != nil {
173173
return err

0 commit comments

Comments
 (0)