Skip to content

Commit

Permalink
Fix io/ioutil import
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Byrgazov <vladislav.byrgazov@xored.com>
  • Loading branch information
Vladislav Byrgazov committed Nov 12, 2024
1 parent d0bc190 commit c794195
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions pkg/kernel/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ package kernel

import (
"io/fs"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -214,8 +213,8 @@ func searchByPCIAddress(ns netns.NsHandle, _, pciAddress string) (netlink.Link,
return errors.Errorf("no net directory under pci device %s: %q", pciAddress, err)
}

var fInfos []fs.FileInfo
fInfos, err = ioutil.ReadDir(netDir)
var fInfos []fs.DirEntry
fInfos, err = os.ReadDir(netDir)
if err != nil {
return errors.Errorf("failed to read net directory %s: %q", netDir, err)
}
Expand Down Expand Up @@ -244,14 +243,14 @@ func findNetDir(basePath string) (string, error) {
if _, err := os.Lstat(subDir); err == nil {
return subDir, nil
}
files, err := ioutil.ReadDir(basePath)
files, err := os.ReadDir(basePath)
if err != nil {
return "", errors.Wrapf(err, "failed to read directory %s", basePath)
}
for _, file := range files {
if file.IsDir() {
subDir = filepath.Join(basePath, file.Name())
subdirFiles, err := ioutil.ReadDir(subDir)
subdirFiles, err := os.ReadDir(subDir)
if err != nil {
return "", errors.Wrapf(err, "failed to read subdirectory %s", subDir)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2021-2022 Nordix Foundation.
//
// Copyright (c) 2020-2023 Cisco and/or its affiliates.
// Copyright (c) 2020-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down

0 comments on commit c794195

Please sign in to comment.