diff options
| author | Eric Biggers <ebiggers@google.com> | 2022-12-04 13:27:43 -0800 |
|---|---|---|
| committer | Eric Biggers <ebiggers3@gmail.com> | 2022-12-04 14:07:39 -0800 |
| commit | 02875cef9010633b6689cfd1e2ceec9107b756b4 (patch) | |
| tree | 9f310eac398e99dd12f42d94967b2e1bf1c7fe83 /filesystem/mountpoint.go | |
| parent | 5373b314473b08f13372ab55b551738307a85fbd (diff) | |
Stop using deprecated package io/ioutil
Since Go 1.16 (which recently became the minimum supported Go version
for this project), the package io/ioutil is deprecated in favor of
equivalent functionality in the io and os packages. staticcheck warns
about this. Address all the warnings by switching to the non-deprecated
replacement functions.
Diffstat (limited to 'filesystem/mountpoint.go')
| -rw-r--r-- | filesystem/mountpoint.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/filesystem/mountpoint.go b/filesystem/mountpoint.go index 0b0693b..0abae06 100644 --- a/filesystem/mountpoint.go +++ b/filesystem/mountpoint.go @@ -25,7 +25,6 @@ import ( "bufio" "fmt" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -537,11 +536,15 @@ func getMountFromLink(link string) (*Mount, error) { } func (mnt *Mount) getFilesystemUUID() (string, error) { - dirContents, err := ioutil.ReadDir(uuidDirectory) + dirEntries, err := os.ReadDir(uuidDirectory) if err != nil { return "", err } - for _, fileInfo := range dirContents { + for _, dirEntry := range dirEntries { + fileInfo, err := dirEntry.Info() + if err != nil { + continue + } if fileInfo.Mode()&os.ModeSymlink == 0 { continue // Only interested in UUID symlinks } |