diff --git a/cmd/cmd.go b/cmd/cmd.go index 76fb95d..9eb7d18 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -15,7 +15,7 @@ package cmd import ( "fmt" - "io/ioutil" + "io" "os" "github.com/spf13/cobra" @@ -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. diff --git a/cmd/monitor.go b/cmd/monitor.go index d3ff946..2c054d8 100644 --- a/cmd/monitor.go +++ b/cmd/monitor.go @@ -16,7 +16,7 @@ package cmd import ( "errors" "fmt" - "io/ioutil" + "io" "os" "path" "path/filepath" @@ -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 diff --git a/cmd/retrohunt.go b/cmd/retrohunt.go index 93eef58..cfc6915 100644 --- a/cmd/retrohunt.go +++ b/cmd/retrohunt.go @@ -16,7 +16,7 @@ package cmd import ( "fmt" "github.com/VirusTotal/vt-cli/utils" - "io/ioutil" + "io" "os" "regexp" "strings" @@ -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