mirror of
https://github.com/golang/go
synced 2024-11-25 00:07:56 -07:00
path: improve documentation for Dir
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6495059
This commit is contained in:
parent
e61c047c3e
commit
b7627d3d1f
@ -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
|
||||
|
@ -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"},
|
||||
|
Loading…
Reference in New Issue
Block a user