From ebbaba281393de259b751779185855001876090a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 10 May 2022 16:16:19 -0700 Subject: [PATCH] path/filepath: document that WalkDir uses OS paths Fixes #52812 Change-Id: Idb70d0540bbf9ecdc64293c62a23f07ee3be883c Reviewed-on: https://go-review.googlesource.com/c/go/+/405615 Run-TryBot: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Reviewed-by: Caleb Spare Run-TryBot: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot --- src/path/filepath/path.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/path/filepath/path.go b/src/path/filepath/path.go index c86b0c0ff8..64f443a4f7 100644 --- a/src/path/filepath/path.go +++ b/src/path/filepath/path.go @@ -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 {