diff options
Diffstat (limited to 'src/os/file_windows.go')
-rw-r--r-- | src/os/file_windows.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/os/file_windows.go b/src/os/file_windows.go index f744a35023..dfc5fc6ce6 100644 --- a/src/os/file_windows.go +++ b/src/os/file_windows.go @@ -168,7 +168,7 @@ func openDir(name string) (file *File, err error) { // openFileNolog is the Windows implementation of OpenFile. func openFileNolog(name string, flag int, perm FileMode) (*File, error) { if name == "" { - return nil, &PathError{"open", name, syscall.ENOENT} + return nil, &PathError{Op: "open", Path: name, Err: syscall.ENOENT} } r, errf := openFile(name, flag, perm) if errf == nil { @@ -178,11 +178,11 @@ func openFileNolog(name string, flag int, perm FileMode) (*File, error) { if errd == nil { if flag&O_WRONLY != 0 || flag&O_RDWR != 0 { r.Close() - return nil, &PathError{"open", name, syscall.EISDIR} + return nil, &PathError{Op: "open", Path: name, Err: syscall.EISDIR} } return r, nil } - return nil, &PathError{"open", name, errf} + return nil, &PathError{Op: "open", Path: name, Err: errf} } func (file *file) close() error { @@ -198,7 +198,7 @@ func (file *file) close() error { if e == poll.ErrFileClosing { e = ErrClosed } - err = &PathError{"close", file.name, e} + err = &PathError{Op: "close", Path: file.name, Err: e} } // no need for a finalizer anymore @@ -236,7 +236,7 @@ func Truncate(name string, size int64) error { func Remove(name string) error { p, e := syscall.UTF16PtrFromString(fixLongPath(name)) if e != nil { - return &PathError{"remove", name, e} + return &PathError{Op: "remove", Path: name, Err: e} } // Go file interface forces us to know whether @@ -267,7 +267,7 @@ func Remove(name string) error { } } } - return &PathError{"remove", name, e} + return &PathError{Op: "remove", Path: name, Err: e} } func rename(oldname, newname string) error { @@ -493,7 +493,7 @@ func readlink(path string) (string, error) { func Readlink(name string) (string, error) { s, err := readlink(fixLongPath(name)) if err != nil { - return "", &PathError{"readlink", name, err} + return "", &PathError{Op: "readlink", Path: name, Err: err} } return s, nil } |