Skip to content

Commit

Permalink
Merge pull request ipfs/go-ipfs-files#39 from ipfs/masih/fix-win-test…
Browse files Browse the repository at this point in the history
…-fail

Fix test failure on Windows caused by nil `sys` in mock `FileInfo`

This commit was moved from ipfs/go-ipfs-files@ac44de8
  • Loading branch information
marten-seemann authored Jul 22, 2021
2 parents 1c18dbc + b973565 commit 9345abc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion files/is_hidden_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ func isHidden(fi os.FileInfo) bool {
return true
}

wi, ok := fi.Sys().(*windows.Win32FileAttributeData)
sys := fi.Sys()
if sys == nil {
return false
}
wi, ok := sys.(*windows.Win32FileAttributeData)
if !ok {
return false
}
Expand Down

0 comments on commit 9345abc

Please sign in to comment.