Browse Source

Remove deprecated io/ioutil import and calls

master
Gregory Rudolph 1 year ago
parent
commit
139d378d1a
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 5
      config.go

5
config.go

@ -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)
} }

Loading…
Cancel
Save