]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1] path: document that Clean deletes trailing slashes.
authorRob Pike <r@golang.org>
Tue, 24 Apr 2012 03:17:05 +0000 (13:17 +1000)
committerRob Pike <r@golang.org>
Tue, 24 Apr 2012 03:17:05 +0000 (13:17 +1000)
««« backport ab273014412e
path: document that Clean deletes trailing slashes.

Fixes #3492.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6112044
»»»

src/pkg/path/filepath/path.go
src/pkg/path/path.go

index 1e7487263674f3aca703f7f0272c282cdd4727e9..a4e429baec18a51afaca0c8831b004637ccb540a 100644 (file)
@@ -30,6 +30,9 @@ const (
 //        that is, replace "/.." by "/" at the beginning of a path,
 //         assuming Separator is '/'.
 //
+// The returned path ends in a slash only if it represents a root directory,
+// such as "/" on Unix or `C:\` on Windows.
+//
 // If the result of this process is an empty string, Clean
 // returns the string ".".
 //
index 13abed0b09da25120f3d920d72b658abb9e2ba83..a7e0415689ca9f4a1b97e545f31f239f8324eb41 100644 (file)
@@ -21,6 +21,8 @@ import (
 //     4. Eliminate .. elements that begin a rooted path:
 //        that is, replace "/.." by "/" at the beginning of a path.
 //
+// The returned path ends in a slash only if it is the root "/".
+//
 // If the result of this process is an empty string, Clean
 // returns the string ".".
 //