From 5125a967100643cebc4501e3d626b44b5ab15747 Mon Sep 17 00:00:00 2001 From: Johnny Luo Date: Thu, 20 Jul 2017 17:20:46 +1000 Subject: [PATCH] os: remove duplicate check from windows os.Stat Fixes #21075 Change-Id: Idfe5002dfe17943844d9427e27f82ce894b92e80 Reviewed-on: https://go-review.googlesource.com/50270 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/os/stat_windows.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/os/stat_windows.go b/src/os/stat_windows.go index 667b99905d..e7a4e0d54a 100644 --- a/src/os/stat_windows.go +++ b/src/os/stat_windows.go @@ -16,9 +16,7 @@ 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) -- 2.50.0