aboutsummaryrefslogtreecommitdiff
path: root/src/path
diff options
context:
space:
mode:
authorMarvin Stenger <marvin.stenger94@gmail.com>2017-10-05 15:50:11 +0200
committerIan Lance Taylor <iant@golang.org>2017-10-05 23:19:42 +0000
commitd153df8e4b5874692f4948e9c8e10720446058e3 (patch)
tree84567a80b3f90d91bb6d1832073505427c51d67c /src/path
parent90d71fe99e21b68e292327c966946f1706d66514 (diff)
downloadgo-d153df8e4b5874692f4948e9c8e10720446058e3.tar.gz
go-d153df8e4b5874692f4948e9c8e10720446058e3.zip
all: revert "all: prefer strings.LastIndexByte over strings.LastIndex"
This reverts https://golang.org/cl/66372. Updates #22148 Change-Id: I3e94af3dfc11a2883bf28e1d5e1f32f98760b3ee Reviewed-on: https://go-review.googlesource.com/68431 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/path')
-rw-r--r--src/path/path.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/path/path.go b/src/path/path.go
index 074cfff67a..5c905110a1 100644
--- a/src/path/path.go
+++ b/src/path/path.go
@@ -145,7 +145,7 @@ func Clean(path string) string {
// file set to path.
// The returned values have the property that path = dir+file.
func Split(path string) (dir, file string) {
- i := strings.LastIndexByte(path, '/')
+ i := strings.LastIndex(path, "/")
return path[:i+1], path[i+1:]
}
@@ -187,7 +187,7 @@ func Base(path string) string {
path = path[0 : len(path)-1]
}
// Find the last element
- if i := strings.LastIndexByte(path, '/'); i >= 0 {
+ if i := strings.LastIndex(path, "/"); i >= 0 {
path = path[i+1:]
}
// If empty now, it had only slashes.