]> Cypherpunks repositories - gostls13.git/commitdiff
path/filepath: document that WalkDir uses OS paths
authorIan Lance Taylor <iant@golang.org>
Tue, 10 May 2022 23:16:19 +0000 (16:16 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 14 Sep 2022 14:19:13 +0000 (14:19 +0000)
Fixes #52812

Change-Id: Idb70d0540bbf9ecdc64293c62a23f07ee3be883c
Reviewed-on: https://go-review.googlesource.com/c/go/+/405615
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Caleb Spare <cespare@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/path/filepath/path.go

index c86b0c0ff819b0b48370e9dea0916ee45af9abe6..64f443a4f794614ba33d7028b901deec8d1bab07 100644 (file)
@@ -482,6 +482,10 @@ func walk(path string, info fs.FileInfo, walkFn WalkFunc) error {
 // to walk that directory.
 //
 // WalkDir does not follow symbolic links.
+//
+// WalkDir calls fn with paths that use the separator character appropriate
+// for the operating system. This is unlike [io/fs.WalkDir], which always
+// uses slash separated paths.
 func WalkDir(root string, fn fs.WalkDirFunc) error {
        info, err := os.Lstat(root)
        if err != nil {