Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 5 days ago
JSON representation

Golang fastest directory walking method

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 main

import (
"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(),
)
}
```