1
0
mirror of https://github.com/golang/go synced 2024-11-18 08:54:45 -07:00

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 <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>
This commit is contained in:
Ian Lance Taylor 2022-05-10 16:16:19 -07:00 committed by Gopher Robot
parent 244127e4b4
commit ebbaba2813

View 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 {