]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - netrc.go
Fix integer decoding
[tofuproxy.git] / netrc.go
index 8cc6560feea63bab82c3d115ba7beb1a9fd706cd..bdc61bb46fca4ed7d720495e00ba82c79ea29820 100644 (file)
--- a/netrc.go
+++ b/netrc.go
@@ -3,7 +3,8 @@
 package tofuproxy
 
 import (
-       "io/ioutil"
+       "errors"
+       "io/fs"
        "log"
        "os"
        "path/filepath"
@@ -19,9 +20,9 @@ func findInNetrc(host string) (string, string) {
                }
                netrcPath = filepath.Join(homeDir, ".netrc")
        }
-       data, err := ioutil.ReadFile(netrcPath)
+       data, err := os.ReadFile(netrcPath)
        if err != nil {
-               if os.IsNotExist(err) {
+               if errors.Is(err, fs.ErrNotExist) {
                        return "", ""
                }
                log.Fatalln(err)