Commit 3d3d5390 authored by Dave Cheney's avatar Dave Cheney

path, path/filepath: remove dead code

Fixes #8503.

Thanks to no.smile.face for the original report.

LGTM=bradfitz, r, ruiu
R=bradfitz, ruiu, r
CC=golang-codereviews
https://golang.org/cl/132730043
parent 84b70df4
......@@ -452,13 +452,6 @@ func Dir(path string) string {
i--
}
dir := Clean(path[len(vol) : i+1])
last := len(dir) - 1
if last > 0 && os.IsPathSeparator(dir[last]) {
dir = dir[:last]
}
if dir == "" {
dir = "."
}
return vol + dir
}
......
......@@ -206,13 +206,5 @@ func IsAbs(path string) bool {
// slash.
func Dir(path string) string {
dir, _ := Split(path)
dir = Clean(dir)
last := len(dir) - 1
if last > 0 && dir[last] == '/' {
dir = dir[:last]
}
if dir == "" {
dir = "."
}
return dir
return Clean(dir)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment