replace deprecated io/ioutil with os and io for cmd

This commit is contained in:
ahrtr
2021-11-02 08:54:28 +08:00
parent 6dd234d85c
commit 972dc46a1f
73 changed files with 187 additions and 239 deletions

View File

@@ -20,7 +20,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
@@ -81,7 +80,7 @@ func runCommand(cmd ...string) (string, error) {
}
func readFile(path string) (string, error) {
content, err := ioutil.ReadFile(path)
content, err := os.ReadFile(path)
// Convert []byte to string and print to screen
return string(content), err
}