aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath/path.go
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2023-02-21 11:46:39 -0800
committerGopher Robot <gobot@golang.org>2023-02-21 20:38:30 +0000
commit34e701ece2138ebb8276c2d413a6ea1ee1ed84a4 (patch)
tree139e07e273f6571f6c6d802c2a8b989ce4c4439b /src/path/filepath/path.go
parent481a6beba5a76403cd1c4be2fe7a6662439984c7 (diff)
downloadgo-34e701ece2138ebb8276c2d413a6ea1ee1ed84a4.tar.xz
path/filepath: document that Clean does not change Windows volume names
Fixes #58348 Change-Id: I4aac0285f11618a45aca6b13c2da2a10a803a9b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/469955 Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/path/filepath/path.go')
-rw-r--r--src/path/filepath/path.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/path/filepath/path.go b/src/path/filepath/path.go
index 32dd887998..5200208117 100644
--- a/src/path/filepath/path.go
+++ b/src/path/filepath/path.go
@@ -84,6 +84,10 @@ const (
// If the result of this process is an empty string, Clean
// returns the string ".".
//
+// On Windows, Clean does not modify the volume name other than to replace
+// occurrences of "/" with `\`.
+// For example, Clean("//host/share/../x") returns `\\host\share\x`.
+//
// See also Rob Pike, “Lexical File Names in Plan 9 or
// Getting Dot-Dot Right,”
// https://9p.io/sys/doc/lexnames.html