diff --git a/ipinfo/config.go b/ipinfo/config.go index 70121b37..ac13b5ec 100644 --- a/ipinfo/config.go +++ b/ipinfo/config.go @@ -2,7 +2,6 @@ package main import ( "encoding/json" - "io/ioutil" "os" "path/filepath" @@ -116,7 +115,7 @@ func ReadTokenFile() (string, error) { return "", err } - token, err := ioutil.ReadFile(path) + token, err := os.ReadFile(path) if err != nil { return "", err } @@ -136,7 +135,7 @@ func SaveConfig(config Config) error { return err } - if err := ioutil.WriteFile(configPath, jsonData, 0644); err != nil { + if err := os.WriteFile(configPath, jsonData, 0644); err != nil { return err } @@ -150,7 +149,7 @@ func ReadConfig() (Config, error) { return Config{}, err } - data, err := ioutil.ReadFile(configPath) + data, err := os.ReadFile(configPath) if err != nil { return Config{}, err } diff --git a/lib/complete/predict/files.go b/lib/complete/predict/files.go index 4654ec4d..a4496a19 100644 --- a/lib/complete/predict/files.go +++ b/lib/complete/predict/files.go @@ -1,7 +1,6 @@ package predict import ( - "io/ioutil" "os" "path/filepath" "strings" @@ -72,7 +71,7 @@ func (f FilesPredictor) listFiles(dir string) []string { } // List directories. - if dirs, err := ioutil.ReadDir(dir); err == nil { + if dirs, err := os.ReadDir(dir); err == nil { for _, d := range dirs { if d.IsDir() { m[filepath.Join(dir, d.Name())] = true