Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
use goang.org/x/sys/windows
Browse files Browse the repository at this point in the history
syscall is mostly deprecated
  • Loading branch information
Stebalien committed Nov 18, 2017
1 parent 2538708 commit 845964d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions is_hidden_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ package files
import (
"path/filepath"
"strings"
"syscall"

windows "golang.org/x/sys/windows"
)

func IsHidden(f File) bool {
Expand All @@ -16,14 +17,14 @@ func IsHidden(f File) bool {
return true
}

p, e := syscall.UTF16PtrFromString(f.FileName())
p, e := windows.UTF16PtrFromString(f.FullPath())
if e != nil {
return false
}

attrs, e := syscall.GetFileAttributes(p)
attrs, e := windows.GetFileAttributes(p)
if e != nil {
return false
}
return attrs&syscall.FILE_ATTRIBUTE_HIDDEN != 0
return attrs&windows.FILE_ATTRIBUTE_HIDDEN != 0
}

0 comments on commit 845964d

Please sign in to comment.