Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikosgram/qwalk
Golang fastest directory walking method
https://github.com/nikosgram/qwalk
directory go go-library go-module go-package golang golang-library golang-module golang-package walk walker
Last synced: 15 days ago
JSON representation
Golang fastest directory walking method
- Host: GitHub
- URL: https://github.com/nikosgram/qwalk
- Owner: nikosgram
- License: bsd-2-clause
- Created: 2020-11-12T14:35:51.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-12T17:18:23.000Z (over 2 years ago)
- Last Synced: 2024-10-08T19:42:07.989Z (about 1 month ago)
- Topics: directory, go, go-library, go-module, go-package, golang, golang-library, golang-module, golang-package, walk, walker
- Language: Go
- Homepage: https://pkg.go.dev/github.com/nikosgram/qwalk
- Size: 44.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# qwalk [![Go Reference](https://pkg.go.dev/badge/github.com/nikosgram/qwalk.svg)](https://pkg.go.dev/github.com/nikosgram/qwalk) [![Go](https://github.com/nikosgram/qwalk/actions/workflows/go.yml/badge.svg)](https://github.com/nikosgram/qwalk/actions/workflows/go.yml) [![CodeQL](https://github.com/nikosgram/qwalk/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/nikosgram/qwalk/actions/workflows/codeql-analysis.yml)
Golang fastest directory walking method
Got the idea of creating this library based on @feyrob's godirlist repo: https://github.com/feyrob/godirlist
## Examples
There are a few examples in the qwalk_test.go and qwalk_bench_test.go files if you want to see a very simplified version of what you can do with qwalk.
```go
package mainimport (
"fmt"
"runtime"
"github.com/nikosgram/qwalk"
)func main() {
// print all no-directory items
qwalk.Walk(
[]string{"."},
func(info qwalk.ItemInfo) bool {
// print only from no-dir items
if !info.Info.IsDir() {
fmt.Println(info.Path)
}// allow dir-listing on all directories
return true
},
runtime.NumCPU(),
)
}
```