From 75918ffdb7c174774d24d34a1ecd0b60bdfc82da Mon Sep 17 00:00:00 2001 From: bcarlin Date: Thu, 29 Feb 2024 00:58:42 +0100 Subject: [PATCH] fix: remove deprecated calls to ioutil --- config.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config.go b/config.go index 1389f1d..5aa8e1e 100644 --- a/config.go +++ b/config.go @@ -6,7 +6,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "path/filepath" ) @@ -74,7 +73,7 @@ type Updater interface { } func read(path string, data interface{}) error { - content, err := ioutil.ReadFile(filepath.Clean(path)) + content, err := os.ReadFile(filepath.Clean(path)) if err != nil { return fmt.Errorf("cannot read config file: %w", err) } @@ -93,7 +92,7 @@ func write(path string, data interface{}) error { return fmt.Errorf("cannot generate config content: %w", err) } - err = ioutil.WriteFile(path, content, 0o600) + err = os.WriteFile(path, content, 0o600) if err != nil { return fmt.Errorf("cannot write config file '%s': %w", path, err) }