Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the ReadDir methods #301

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading