use Access(F_OK) do not need to check for permissions (#18492)

This commit is contained in:
Harshavardhana
2023-11-21 15:08:41 -08:00
committed by GitHub
parent 58306a9d34
commit fe3e49c4eb
2 changed files with 7 additions and 15 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ import (
)
func access(name string) error {
if err := unix.Access(name, unix.R_OK|unix.W_OK); err != nil {
if err := unix.Access(name, unix.F_OK); err != nil {
return &os.PathError{Op: "lstat", Path: name, Err: err}
}
return nil