WARN: -> [WARN]. ioutil.WriteFile changed to modern os.WriteFile.
This commit is contained in:
parent
c56ef45ed1
commit
7c4c378508
@ -2,7 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"strconv"
|
||||
@ -37,14 +36,14 @@ func LoadConfiguration(path string) (conf *Configuration, err error) {
|
||||
case "indented_output":
|
||||
v, err := strconv.ParseBool(kv[1])
|
||||
if err != nil {
|
||||
log.Printf("WARN: could not parse \"indented_output\", valid values are true or false. Defaulted to false.\n")
|
||||
log.Printf("[WARN] could not parse \"indented_output\", valid values are true or false. Defaulted to false.\n")
|
||||
}
|
||||
conf.IndentedOutput = v
|
||||
case "processes":
|
||||
if kv[1] != "" {
|
||||
conf.Processes = append(conf.Processes, strings.Split(kv[1], " ")...)
|
||||
} else {
|
||||
log.Printf("WARN: \"processes\" list is empty.\n")
|
||||
log.Printf("[WARN] \"processes\" list is empty.\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -64,8 +63,7 @@ func (conf *Configuration) StoreConfiguration(path string) (err error) {
|
||||
config.WriteByte('\n')
|
||||
config.WriteString("processes = ")
|
||||
config.WriteString(strings.Join(conf.Processes, " "))
|
||||
|
||||
if err := ioutil.WriteFile(path, []byte(config.String()), 0644); err != nil {
|
||||
if err := os.WriteFile(path, []byte(config.String()), 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user