From 7c4c378508c8094e3212d1c8f40b7f603cfa5244 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Mon, 10 Oct 2022 00:08:30 +0400 Subject: [PATCH] WARN: -> [WARN]. ioutil.WriteFile changed to modern os.WriteFile. --- configuration.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/configuration.go b/configuration.go index 0559fcc..1af1763 100644 --- a/configuration.go +++ b/configuration.go @@ -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 }