Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: remove duplicate check from windows os.Stat #21075

Closed
markus-oberhumer opened this issue Jul 18, 2017 · 2 comments
Closed

os: remove duplicate check from windows os.Stat #21075

markus-oberhumer opened this issue Jul 18, 2017 · 2 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@markus-oberhumer
Copy link

There is a duplicate check for file == nil in the windows version of os.Stat().

Seems like an oversight in git commit 11c7b44 by @ianlancetaylor .

What version of Go are you using (go version)?

Current go git master 1.9.x 73d0273 .

What did you do?

$ git diff 73d02735734e1ed1e4d1f5a7c534206596f3903a
diff --git a/src/os/stat_windows.go b/src/os/stat_windows.go
index 667b99905d..f9d8904bc4 100644
--- a/src/os/stat_windows.go
+++ b/src/os/stat_windows.go
@@ -16,9 +16,6 @@ func (file *File) Stat() (FileInfo, error) {
        if file == nil {
                return nil, ErrInvalid
        }
-       if file == nil {
-               return nil, syscall.EINVAL
-       }
        if file.isdir() {
                // I don't know any better way to do that for directory
                return Stat(file.dirinfo.path)

Please feel free to fix this trivial issue by yourself - I don't have a Gerrit account and a CLA (yet).

@ianlancetaylor ianlancetaylor added this to the Go1.10 milestone Jul 18, 2017
@bradfitz bradfitz added help wanted NeedsFix The path to resolution is known, but the work has not been done. Suggested Issues that may be good for new contributors looking for work to do. labels Jul 20, 2017
@johnnyluo
Copy link
Contributor

I would like to work on this

@gopherbot
Copy link

CL https://golang.org/cl/50270 mentions this issue.

@golang golang locked and limited conversation to collaborators Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

5 participants