diff options
author | Cherry Zhang <cherryyz@google.com> | 2020-10-28 09:12:20 -0400 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2020-10-28 09:12:20 -0400 |
commit | a16e30d162c1c7408db7821e7b9513cefa09c6ca (patch) | |
tree | af752ba9ba44c547df39bb0af9bff79f610ba9d5 /src/os/stat_windows.go | |
parent | 91e4d2d57bc341dd82c98247117114c851380aef (diff) | |
parent | cf6cfba4d5358404dd890f6025e573a4b2156543 (diff) | |
download | go-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/stat_windows.go')
-rw-r--r-- | src/os/stat_windows.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/os/stat_windows.go b/src/os/stat_windows.go index 3e0e0a59ed..da4c49090e 100644 --- a/src/os/stat_windows.go +++ b/src/os/stat_windows.go @@ -27,7 +27,7 @@ func (file *File) Stat() (FileInfo, error) { ft, err := file.pfd.GetFileType() if err != nil { - return nil, &PathError{"GetFileType", file.name, err} + return nil, &PathError{Op: "GetFileType", Path: file.name, Err: err} } switch ft { case syscall.FILE_TYPE_PIPE, syscall.FILE_TYPE_CHAR: @@ -45,14 +45,14 @@ func (file *File) Stat() (FileInfo, error) { // stat implements both Stat and Lstat of a file. func stat(funcname, name string, createFileAttrs uint32) (FileInfo, error) { if len(name) == 0 { - return nil, &PathError{funcname, name, syscall.Errno(syscall.ERROR_PATH_NOT_FOUND)} + return nil, &PathError{Op: funcname, Path: name, Err: syscall.Errno(syscall.ERROR_PATH_NOT_FOUND)} } if isWindowsNulName(name) { return &devNullStat, nil } namep, err := syscall.UTF16PtrFromString(fixLongPath(name)) if err != nil { - return nil, &PathError{funcname, name, err} + return nil, &PathError{Op: funcname, Path: name, Err: err} } // Try GetFileAttributesEx first, because it is faster than CreateFile. @@ -80,7 +80,7 @@ func stat(funcname, name string, createFileAttrs uint32) (FileInfo, error) { var fd syscall.Win32finddata sh, err := syscall.FindFirstFile(namep, &fd) if err != nil { - return nil, &PathError{"FindFirstFile", name, err} + return nil, &PathError{Op: "FindFirstFile", Path: name, Err: err} } syscall.FindClose(sh) fs := newFileStatFromWin32finddata(&fd) @@ -94,7 +94,7 @@ func stat(funcname, name string, createFileAttrs uint32) (FileInfo, error) { h, err := syscall.CreateFile(namep, 0, 0, nil, syscall.OPEN_EXISTING, createFileAttrs, 0) if err != nil { - return nil, &PathError{"CreateFile", name, err} + return nil, &PathError{Op: "CreateFile", Path: name, Err: err} } defer syscall.CloseHandle(h) |