3 ms·
filepath.Walk() isn't much better: > The files are walked in lexical order, which makes the output deterministic but means that for very large directories Walk
by boring_twenties 6y ago
filepath.Walk() isn't much better:
> The files are walked in lexical order, which makes the output deterministic but means that for very large directories Walk can be inefficient.
If it's fine for "most use cases," that's all well and good. Just implement the correct interface, which is fine for ALL use cases, and then implement this sugar on top of that.
- hu3 6y agoThey are aware: https://github.com/golang/go/issues/16399 https://github.com/golang/go/issues/16399 Seems like they postponed incorporating fastwalk into the standard library because it would break API: https://godoc.org/golang.org/x/tools/internal/fastwalk https://godoc.org/golang.org/x/tools/internal/fastwalk Perhaps until then one could use libraries that expose fastwalk: https://github.com/karrick/godirwalk https://github.com/karrick/godirwalk https://github.com/s12chung/fastwalk https://github.com/s12chung/fastwalk