Commit 6df181a7 authored by Russ Cox's avatar Russ Cox

path/filepath: document Dir better

This comment matches the one in path.

Fixes #4837.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7305100
parent 1fe8fdf7
...@@ -437,7 +437,8 @@ func Base(path string) string { ...@@ -437,7 +437,8 @@ func Base(path string) string {
} }
// Dir returns all but the last element of path, typically the path's directory. // Dir returns all but the last element of path, typically the path's directory.
// Trailing path separators are removed before processing. // After dropping the final element, the path is Cleaned and trailing
// slashes are removed.
// If the path is empty, Dir returns ".". // If the path is empty, Dir returns ".".
// If the path consists entirely of separators, Dir returns a single separator. // If the path consists entirely of separators, Dir returns a single separator.
// The returned path does not end in a separator unless it is the root directory. // The returned path does not end in a separator unless it is the root directory.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment