|
|
|
|
|
by TheDong
2338 days ago
|
|
> with no option to not sort them Just implement your own directory walk based on `readdir` or whatever fs operations you need directly. Or use a library that has already done this: https://github.com/karrick/godirwalk#configurable-sorting-of... The high level interface made one choice. The escape hatch is to use a lower level interface. |
|
Of course one could always just make direct syscalls or use a library that does, but this was a comment about stdlib. These would likely be implemented differently in hindsight per discussions on the Go project; and there have been discussions about improving them somehow in Go 2(readdir2?).