diff --git a/builder/dockerfile/copy.go b/builder/dockerfile/copy.go index 397f8ffc8a..a69deb0f36 100644 --- a/builder/dockerfile/copy.go +++ b/builder/dockerfile/copy.go @@ -258,7 +258,7 @@ func (o *copier) storeInPathCache(im *imageMount, path string, hash string) { func (o *copier) copyWithWildcards(origPath string) ([]copyInfo, error) { root := o.source.Root() var copyInfos []copyInfo - if err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + if err := filepath.WalkDir(root, func(path string, _ os.DirEntry, err error) error { if err != nil { return err } @@ -316,7 +316,7 @@ func walkSource(source builder.Source, origPath string) ([]string, error) { } // Must be a dir var subfiles []string - err = filepath.Walk(fp, func(path string, info os.FileInfo, err error) error { + err = filepath.WalkDir(fp, func(path string, _ os.DirEntry, err error) error { if err != nil { return err } diff --git a/builder/dockerfile/copy_unix.go b/builder/dockerfile/copy_unix.go index 2099401485..d13d7a9890 100644 --- a/builder/dockerfile/copy_unix.go +++ b/builder/dockerfile/copy_unix.go @@ -26,7 +26,7 @@ func fixPermissions(source, destination string, identity idtools.Identity, overr // We Walk on the source rather than on the destination because we don't // want to change permissions on things we haven't created or modified. - return filepath.Walk(source, func(fullpath string, _ os.FileInfo, _ error) error { + return filepath.WalkDir(source, func(fullpath string, _ os.DirEntry, _ error) error { // Do not alter the walk root iff. it existed before, as it doesn't fall under // the domain of "things we should chown". if skipChownRoot && source == fullpath { diff --git a/builder/remotecontext/tarsum.go b/builder/remotecontext/tarsum.go index e6486e9736..566c03c967 100644 --- a/builder/remotecontext/tarsum.go +++ b/builder/remotecontext/tarsum.go @@ -66,7 +66,7 @@ func (cs *CachableSource) Scan() error { return err } txn := iradix.New().Txn() - err = filepath.Walk(cs.root, func(path string, info os.FileInfo, err error) error { + err = filepath.WalkDir(cs.root, func(path string, _ os.DirEntry, err error) error { if err != nil { return errors.Wrapf(err, "failed to walk %s", path) }