replace deprecated io/ioutil with os and io for cmd
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user