Skip to content

Commit

Permalink
vfs: error strings should not be capitalized
Browse files Browse the repository at this point in the history
  • Loading branch information
albertony committed May 16, 2022
1 parent 2437eb3 commit 0e77072
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions vfs/vfscache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,32 +365,32 @@ func rename(osOldPath, osNewPath string) error {
if os.IsNotExist(err) {
return nil
}
return fmt.Errorf("Failed to stat source: %s: %w", osOldPath, err)
return fmt.Errorf("failed to stat source: %s: %w", osOldPath, err)
}
if !sfi.Mode().IsRegular() {
// cannot copy non-regular files (e.g., directories, symlinks, devices, etc.)
return fmt.Errorf("Non-regular source file: %s (%q)", sfi.Name(), sfi.Mode().String())
return fmt.Errorf("non-regular source file: %s (%q)", sfi.Name(), sfi.Mode().String())
}
dfi, err := os.Stat(osNewPath)
if err != nil {
if !os.IsNotExist(err) {
return fmt.Errorf("Failed to stat destination: %s: %w", osNewPath, err)
return fmt.Errorf("failed to stat destination: %s: %w", osNewPath, err)
}
parent := vfscommon.OSFindParent(osNewPath)
err = createDir(parent)
if err != nil {
return fmt.Errorf("Failed to create parent dir: %s: %w", parent, err)
return fmt.Errorf("failed to create parent dir: %s: %w", parent, err)
}
} else {
if !(dfi.Mode().IsRegular()) {
return fmt.Errorf("Non-regular destination file: %s (%q)", dfi.Name(), dfi.Mode().String())
return fmt.Errorf("non-regular destination file: %s (%q)", dfi.Name(), dfi.Mode().String())
}
if os.SameFile(sfi, dfi) {
return nil
}
}
if err = os.Rename(osOldPath, osNewPath); err != nil {
return fmt.Errorf("Failed to rename in cache: %s to %s: %w", osOldPath, osNewPath, err)
return fmt.Errorf("failed to rename in cache: %s to %s: %w", osOldPath, osNewPath, err)
}
return nil
}
Expand Down

0 comments on commit 0e77072

Please sign in to comment.