]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/files.go
Replace deprecated ioutil
[rbdr/mobius] / hotline / files.go
index aa248f81893f06ca0d61e2b27e0f106a9b707c10..1eeef593b8536709708932245264da992a7d38aa 100644 (file)
@@ -4,7 +4,6 @@ import (
        "encoding/binary"
        "errors"
        "io/fs"
-       "io/ioutil"
        "os"
        "path/filepath"
        "regexp"
@@ -66,7 +65,7 @@ func getFileNameList(path string, ignoreList []string) (fields []Field, err erro
                        }
 
                        if rFile.IsDir() {
-                               dir, err := ioutil.ReadDir(filepath.Join(path, file.Name()))
+                               dir, err := os.ReadDir(filepath.Join(path, file.Name()))
                                if err != nil {
                                        return fields, err
                                }
@@ -88,7 +87,7 @@ func getFileNameList(path string, ignoreList []string) (fields []Field, err erro
                        }
 
                } else if file.IsDir() {
-                       dir, err := ioutil.ReadDir(filepath.Join(path, file.Name()))
+                       dir, err := os.ReadDir(filepath.Join(path, file.Name()))
                        if err != nil {
                                return fields, err
                        }
@@ -131,7 +130,7 @@ func getFileNameList(path string, ignoreList []string) (fields []Field, err erro
                if err != nil {
                        return nil, err
                }
-               fields = append(fields, NewField(fieldFileNameWithInfo, b))
+               fields = append(fields, NewField(FieldFileNameWithInfo, b))
        }
 
        return fields, nil