Skip to content

Commit

Permalink
fix deplicated io/ioutils | golang/go#40025 (#90)
Browse files Browse the repository at this point in the history
Co-authored-by: whonion <[email protected]>
  • Loading branch information
whonion and whonion authored Feb 19, 2024
1 parent 3712a1b commit d758174
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package cmd

import (
"fmt"
"io/ioutil"
"io"
"os"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -126,9 +126,9 @@ func addHumanFlag(flags *pflag.FlagSet) {
// the data is read from stdin.
func ReadFile(filename string) ([]byte, error) {
if filename == "-" {
return ioutil.ReadAll(os.Stdin)
return io.ReadAll(os.Stdin)
}
return ioutil.ReadFile(filename)
return os.ReadFile(filename)
}

// NewAPIClient returns a new utils.APIClient.
Expand Down
4 changes: 2 additions & 2 deletions cmd/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package cmd
import (
"errors"
"fmt"
"io/ioutil"
"io"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -187,7 +187,7 @@ func NewMonitorItemsSetDetailsCmd() *cobra.Command {
if len(args) == 0 {
return errors.New("No item provided")
} else if len(args) == 1 {
detailsBytes, err := ioutil.ReadAll(os.Stdin)
detailsBytes, err := io.ReadAll(os.Stdin)
details = string(detailsBytes)
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions cmd/retrohunt.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package cmd
import (
"fmt"
"github.com/VirusTotal/vt-cli/utils"
"io/ioutil"
"io"
"os"
"regexp"
"strings"
Expand Down Expand Up @@ -165,9 +165,9 @@ func NewRetrohuntStartCmd() *cobra.Command {

var rules []byte
if args[0] == "-" {
rules, err = ioutil.ReadAll(os.Stdin)
rules, err = io.ReadAll(os.Stdin)
} else {
rules, err = ioutil.ReadFile(args[0])
rules, err = os.ReadFile(args[0])
}
if err != nil {
return err
Expand Down

0 comments on commit d758174

Please sign in to comment.