fix: remove deprecated calls to ioutil
This commit is contained in:
parent
26d78be263
commit
75918ffdb7
1 changed files with 2 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue