summaryrefslogtreecommitdiff
path: root/src/os/file_windows.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2020-10-28 09:12:20 -0400
committerCherry Zhang <cherryyz@google.com>2020-10-28 09:12:20 -0400
commita16e30d162c1c7408db7821e7b9513cefa09c6ca (patch)
treeaf752ba9ba44c547df39bb0af9bff79f610ba9d5 /src/os/file_windows.go
parent91e4d2d57bc341dd82c98247117114c851380aef (diff)
parentcf6cfba4d5358404dd890f6025e573a4b2156543 (diff)
downloadgo-git-dev.link.tar.gz
[dev.link] all: merge branch 'master' into dev.linkdev.link
Clean merge. Change-Id: Ia7b2808bc649790198d34c226a61d9e569084dc5
Diffstat (limited to 'src/os/file_windows.go')
-rw-r--r--src/os/file_windows.go14
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
}