]> Cypherpunks repositories - gostls13.git/commitdiff
path: improve documentation for Dir
authorRob Pike <r@golang.org>
Thu, 30 Aug 2012 18:16:41 +0000 (11:16 -0700)
committerRob Pike <r@golang.org>
Thu, 30 Aug 2012 18:16:41 +0000 (11:16 -0700)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6495059

src/pkg/path/path.go
src/pkg/path/path_test.go

index 649c1504c83a3d0cb38dc244c85d08970417d7d7..bdb85c6b92a7445c11713324041586faa8ebb401 100644 (file)
@@ -198,7 +198,8 @@ func IsAbs(path string) bool {
 }
 
 // Dir returns all but the last element of path, typically the path's directory.
-// The path is Cleaned and trailing slashes are removed before processing.
+// After dropping the final element using Split, the path is Cleaned and trailing
+// slashes are removed.
 // If the path is empty, Dir returns ".".
 // If the path consists entirely of slashes followed by non-slash bytes, Dir
 // returns a single slash. In any other case, the returned path does not end in a
index 109005de39160907dc8b03bd2b10235e7caa7a6e..0f353be34dd7c2d342420ac9f701155e96d0927b 100644 (file)
@@ -200,6 +200,7 @@ var dirtests = []PathTest{
        {"x/", "x"},
        {"abc", "."},
        {"abc/def", "abc"},
+       {"abc////def", "abc"},
        {"a/b/.x", "a/b"},
        {"a/b/c.", "a/b"},
        {"a/b/c.x", "a/b"},