[docs minor] close #16553 (#17612)

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
flywind
2021-04-02 15:18:40 +08:00
committed by GitHub
parent 2365b5250e
commit 792a03b756

View File

@@ -2266,16 +2266,12 @@ iterator walkDir*(dir: string; relative = false, checkDir = false):
## / fileA2.txt
##
## and this code:
##
## .. code-block:: Nim
## for kind, path in walkDir("dirA"):
## echo(path)
##
## produce this output (but not necessarily in this order!)::
## dirA/dirB
## dirA/dirC
## dirA/fileA1.txt
## dirA/fileA2.txt
runnableExamples("-r:off"):
import std/[strutils, sugar]
# note: order is not guaranteed
# this also works at compile time
assert collect(for k in walkDir("dirA"): k.path).join(" ") ==
"dirA/dirB dirA/dirC dirA/fileA2.txt dirA/fileA1.txt"
##
## See also:
## * `walkPattern iterator <#walkPattern.i,string>`_