summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2011-12-21 11:46:42 -0800
committerRob Pike <r@golang.org>2011-12-21 11:46:42 -0800
commit97d94cddd425d5aa0febdd1eb56b95646b56846f (patch)
tree560f0be93201e073561da392c2d0ff2f2d11aa8e
parentd2ae48c362329cdca45bcd9340d1e20d1c44e357 (diff)
downloadgo-97d94cddd425d5aa0febdd1eb56b95646b56846f.tar.gz
path/filepath.Rel: document that the returned path is always relative
Fixes issue 2593. R=rsc, alex.brainman, n13m3y3r CC=golang-dev http://codereview.appspot.com/5500052
-rw-r--r--src/pkg/path/filepath/path.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/path/filepath/path.go b/src/pkg/path/filepath/path.go
index e3d6c342c..68cbae664 100644
--- a/src/pkg/path/filepath/path.go
+++ b/src/pkg/path/filepath/path.go
@@ -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) {