https://github.com/tobychui/gohidden
Go module to set a hidden folder and check if a folder is hidden
https://github.com/tobychui/gohidden
Last synced: about 1 month ago
JSON representation
Go module to set a hidden folder and check if a folder is hidden
- Host: GitHub
- URL: https://github.com/tobychui/gohidden
- Owner: tobychui
- License: mit
- Created: 2021-09-11T05:46:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-12T04:13:17.000Z (over 3 years ago)
- Last Synced: 2025-04-24T05:43:26.761Z (about 1 month ago)
- Language: Go
- Size: 6.84 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goHidden
[](https://pkg.go.dev/github.com/tobychui/goHidden)A Go module to set a folder hidden and check if a folder is hidden
Support Windows and Linux
## Usage
```
//Hide a folder
err := hidden.HideFile("./test")
if err != nil {
panic(err)
}//Check if a folder is hidden
isHidden, err := hidden.IsHidden("./test", false)
if err != nil {
panic(err)
}
```You can enable parent directories checking on ```IsHidden``` by passing "true" as the last parameter for ```IsHidden```. This will allow```IsHidden``` to check all the upstream folders to see if the file is located inside a hidden folder. Set this to false for checking only the targeted file / folder.
```
hidden.HideFile("./test")
isHidden, _ := hidden.IsHidden("./test/myfile.txt", true)
//isHidden is true
```## License
MIT
###