Skip to content

Commit

Permalink
Fix the ReadDir methods (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwneisen authored Jan 22, 2024
1 parent 9ac80da commit 2933c77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions config/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package config

import (
"io/ioutil"
"os"
"path/filepath"
"time"
Expand All @@ -36,7 +35,7 @@ type OSInterface interface {
Hostname() (name string, err error)
Chtimes(path string, atime time.Time, mtime time.Time) error
Pipe() (r *os.File, w *os.File, err error)
ReadDir(dirname string) ([]os.FileInfo, error)
ReadDir(dirname string) ([]os.DirEntry, error)
Glob(pattern string) ([]string, error)
Open(name string) (*os.File, error)
OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
Expand Down Expand Up @@ -99,8 +98,8 @@ func (RealOS) Pipe() (r *os.File, w *os.File, err error) {
}

// ReadDir will call ioutil.ReadDir to return the files under the directory.
func (RealOS) ReadDir(dirname string) ([]os.FileInfo, error) {
return ioutil.ReadDir(dirname)
func (RealOS) ReadDir(dirname string) ([]os.DirEntry, error) {
return os.ReadDir(dirname)
}

// Glob will call filepath.Glob to return the names of all files matching
Expand Down
4 changes: 2 additions & 2 deletions vendor/k8s.io/kubernetes/pkg/kubelet/container/testing/os.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2933c77

Please sign in to comment.