diff options
| author | Rob Pike <r@golang.org> | 2011-12-21 11:46:42 -0800 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2011-12-21 11:46:42 -0800 |
| commit | 18f7c0a3f6f39af5cd2db484dbf0817fbfb526d5 (patch) | |
| tree | 1905b5f5b8bb6b40ae524b1fd5b0c69fb37e8fdb /src/pkg/path | |
| parent | 71f0fb77602701bf3e3f6efd3aa1be5d42a64458 (diff) | |
| download | go-18f7c0a3f6f39af5cd2db484dbf0817fbfb526d5.tar.xz | |
path/filepath.Rel: document that the returned path is always relative
Fixes #2593.
R=rsc, alex.brainman, n13m3y3r
CC=golang-dev
https://golang.org/cl/5500052
Diffstat (limited to 'src/pkg/path')
| -rw-r--r-- | src/pkg/path/filepath/path.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/path/filepath/path.go b/src/pkg/path/filepath/path.go index e3d6c342ca..68cbae6644 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) { |
