From: Rob Pike Date: Tue, 24 Apr 2012 03:17:05 +0000 (+1000) Subject: [release-branch.go1] path: document that Clean deletes trailing slashes. X-Git-Tag: go1.0.1~11 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c619931610c53441685a34babe391073002c2e42;p=gostls13.git [release-branch.go1] path: document that Clean deletes trailing slashes. ««« backport ab273014412e path: document that Clean deletes trailing slashes. Fixes #3492. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6112044 »»» --- diff --git a/src/pkg/path/filepath/path.go b/src/pkg/path/filepath/path.go index 1e74872636..a4e429baec 100644 --- a/src/pkg/path/filepath/path.go +++ b/src/pkg/path/filepath/path.go @@ -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 ".". // diff --git a/src/pkg/path/path.go b/src/pkg/path/path.go index 13abed0b09..a7e0415689 100644 --- a/src/pkg/path/path.go +++ b/src/pkg/path/path.go @@ -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 ".". //