diff options
| author | Hyang-Ah (Hana) Kim <hyangah@gmail.com> | 2015-03-10 12:31:33 -0400 |
|---|---|---|
| committer | Hyang-Ah Hana Kim <hyangah@gmail.com> | 2015-03-11 20:25:35 +0000 |
| commit | eb96bb19927f2dea87a3c98bbe82f4984ebe30b4 (patch) | |
| tree | e2b115860ffdaf3d6fc4d99c9acc61589fc4ea19 /src/path/filepath | |
| parent | cd5b144d9896c05169fea4ed6d3cad9267e3251d (diff) | |
| download | go-eb96bb19927f2dea87a3c98bbe82f4984ebe30b4.tar.xz | |
path/filepath: clarify the package doc about '/' in returned results.
The slash is replaced with os.PathSeparator before returning.
Split, SplitList are the exceptions; comments for them mention this.
Fixes golang/go#10122.
Change-Id: I66dbee8d09f378582e046be8df309a3930151820
Reviewed-on: https://go-review.googlesource.com/7310
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/path/filepath')
| -rw-r--r-- | src/path/filepath/path.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/path/filepath/path.go b/src/path/filepath/path.go index ebdd9f5968..f9b041bd46 100644 --- a/src/path/filepath/path.go +++ b/src/path/filepath/path.go @@ -4,6 +4,9 @@ // Package filepath implements utility routines for manipulating filename paths // in a way compatible with the target operating system-defined file paths. +// +// Functions in this package replace any occurrences of the slash ('/') character +// with os.PathSeparator when returning paths unless otherwise specified. package filepath import ( @@ -174,7 +177,8 @@ func FromSlash(path string) string { // SplitList splits a list of paths joined by the OS-specific ListSeparator, // usually found in PATH or GOPATH environment variables. -// Unlike strings.Split, SplitList returns an empty slice when passed an empty string. +// Unlike strings.Split, SplitList returns an empty slice when passed an empty +// string. SplitList does not replace slash characters in the returned paths. func SplitList(path string) []string { return splitList(path) } |
