Remove deprecated io/ioutil import and calls
This commit is contained in:
@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
@ -16,7 +15,7 @@ import (
|
|||||||
|
|
||||||
func loadConfig() {
|
func loadConfig() {
|
||||||
var c Config
|
var c Config
|
||||||
confFile, _ := ioutil.ReadFile(configFile)
|
confFile, _ := os.ReadFile(configFile)
|
||||||
err := json.Unmarshal([]byte(confFile), &c)
|
err := json.Unmarshal([]byte(confFile), &c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.LogErrorType(err)
|
log.LogErrorType(err)
|
||||||
@ -52,7 +51,7 @@ func saveConfig() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.LogErrorType(err)
|
log.LogErrorType(err)
|
||||||
}
|
}
|
||||||
err = ioutil.WriteFile(configFile, file, 0600)
|
err = os.WriteFile(configFile, file, 0600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.LogErrorType(err)
|
log.LogErrorType(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user