]> Cypherpunks repositories - gostls13.git/commitdiff
path/filepath.Rel: document that the returned path is always relative
authorRob Pike <r@golang.org>
Wed, 21 Dec 2011 19:46:42 +0000 (11:46 -0800)
committerRob Pike <r@golang.org>
Wed, 21 Dec 2011 19:46:42 +0000 (11:46 -0800)
Fixes #2593.

R=rsc, alex.brainman, n13m3y3r
CC=golang-dev
https://golang.org/cl/5500052

src/pkg/path/filepath/path.go

index e3d6c342ca6878ca209f54a10f8d9c81bf0f3996..68cbae664497ece2ae6fd40b96b516b4b7407d11 100644 (file)
@@ -262,6 +262,8 @@ func Abs(path string) (string, error) {
 // Rel returns a relative path that is lexically equivalent to targpath when
 // joined to basepath with an intervening separator. That is,
 // Join(basepath, Rel(basepath, targpath)) is equivalent to targpath itself.
+// On success, the returned path will always be relative to basepath,
+// even if basepath and targpath share no elements.
 // An error is returned if targpath can't be made relative to basepath or if
 // knowing the current working directory would be necessary to compute it.
 func Rel(basepath, targpath string) (string, error) {