From: Rob Pike Date: Fri, 21 Sep 2012 19:54:52 +0000 (+1000) Subject: [release-branch.go1] path: improve documentation for Dir X-Git-Tag: go1.0.3~59 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9d7ca4b0e62d7f118d126395fc64d05d0e6fa6c9;p=gostls13.git [release-branch.go1] path: improve documentation for Dir ««« backport 735963d94dad path: improve documentation for Dir R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6495059 »»» --- diff --git a/src/pkg/path/path.go b/src/pkg/path/path.go index a7e0415689..b07534b36f 100644 --- a/src/pkg/path/path.go +++ b/src/pkg/path/path.go @@ -166,7 +166,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 diff --git a/src/pkg/path/path_test.go b/src/pkg/path/path_test.go index 77f080433b..65be550604 100644 --- a/src/pkg/path/path_test.go +++ b/src/pkg/path/path_test.go @@ -181,6 +181,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"},