From c7941957c7b38105be41222685111c00c6d48e93 Mon Sep 17 00:00:00 2001 From: Vladislav Byrgazov Date: Tue, 12 Nov 2024 13:48:15 +0500 Subject: [PATCH] Fix io/ioutil import Signed-off-by: Vladislav Byrgazov --- pkg/kernel/link.go | 9 ++++----- .../ipcontext/ipaddress/common.go | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/kernel/link.go b/pkg/kernel/link.go index ef7b1ff0..f1b9536f 100644 --- a/pkg/kernel/link.go +++ b/pkg/kernel/link.go @@ -26,7 +26,6 @@ package kernel import ( "io/fs" - "io/ioutil" "os" "path/filepath" @@ -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) } @@ -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) } diff --git a/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go b/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go index 1fc0775f..fab25474 100644 --- a/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go +++ b/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/ipaddress/common.go @@ -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 //