Skip to content

Commit

Permalink
Fixes GoogleContainerTools#1469 : Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Anugushashank authored and anugu-chegg committed Nov 4, 2020
1 parent dab6cf6 commit b336cbe
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pkg/util/fs_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -749,16 +749,16 @@ func Volumes() []string {
}

func mkdirAllWithPermissions(path string, mode os.FileMode, uid, gid int64) error {
// Check if a file already exists on the path, if yes then delete it
info, err := os.Stat(path)
if !os.IsNotExist(err) {
if !info.IsDir() {
logrus.Tracef("removing file because it needs to be a directory %s", path)
if err := os.Remove(path); err != nil {
return errors.Wrapf(err, "error removing %s to make way for new directory.", path)
}
}
}
// Check if a file already exists on the path, if yes then delete it
info, err := os.Stat(path)
if !os.IsNotExist(err) {
if !info.IsDir() {
logrus.Tracef("removing file because it needs to be a directory %s", path)
if err := os.Remove(path); err != nil {
return errors.Wrapf(err, "error removing %s to make way for new directory.", path)
}
}
}

if err := os.MkdirAll(path, mode); err != nil {
return err
Expand Down

0 comments on commit b336cbe

Please sign in to comment.