From: Damien Neil Date: Tue, 21 Feb 2023 19:46:39 +0000 (-0800) Subject: path/filepath: document that Clean does not change Windows volume names X-Git-Tag: go1.21rc1~1527 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=34e701ece2138ebb8276c2d413a6ea1ee1ed84a4;p=gostls13.git 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 Auto-Submit: Damien Neil TryBot-Result: Gopher Robot Run-TryBot: Damien Neil --- 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