Commit 5e907e38 authored by Eric Rutherford's avatar Eric Rutherford Committed by Rob Pike

path: improve documentation to call out cases where Clean is called

Rewording the comments for Join to do a better job of calling out
when Clean is called. Also clarifing other portions of the comment.

Fixes #29875

Change-Id: Ied43983bb10a97922898d28af133de0930224496
Reviewed-on: https://go-review.googlesource.com/c/go/+/194339Reviewed-by: default avatarRob Pike <r@golang.org>
parent e710a1fb
......@@ -149,9 +149,10 @@ func Split(path string) (dir, file string) {
return path[:i+1], path[i+1:]
}
// Join joins any number of path elements into a single path, adding a
// separating slash if necessary. The result is Cleaned; in particular,
// all empty strings are ignored.
// Join joins the argument's path elements into a single path,
// separating them with slashes. The result is Cleaned. However,
// if the argument list is empty or all its elements are empty,
// Join returns an empty string.
func Join(elem ...string) string {
for i, e := range elem {
if e != "" {
......
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