diff options
author | Eric Rutherford <erutherford@gmail.com> | 2019-09-09 13:56:53 -0500 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2019-09-09 22:56:39 +0000 |
commit | 5e907e38b8e660aa258b34f3c022d5b697dad6f1 (patch) | |
tree | 712c6c4413dd50ba0f32ba6d834faf97ed358ab9 /src/path | |
parent | e710a1fb2e36b645b103d9f72d47837171336279 (diff) | |
download | go-5e907e38b8e660aa258b34f3c022d5b697dad6f1.tar.gz go-5e907e38b8e660aa258b34f3c022d5b697dad6f1.zip |
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/+/194339
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/path')
-rw-r--r-- | src/path/path.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/path/path.go b/src/path/path.go index 5c905110a1..09a9d00c34 100644 --- a/src/path/path.go +++ b/src/path/path.go @@ -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 != "" { |