Skip to content

Commit

Permalink
path, path/filepath: remove dead code
Browse files Browse the repository at this point in the history
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
  • Loading branch information
davecheney committed Aug 22, 2014
1 parent 84b70df commit 3d3d539
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
7 changes: 0 additions & 7 deletions src/pkg/path/filepath/path.go
Expand Up @@ -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
}

Expand Down
10 changes: 1 addition & 9 deletions src/pkg/path/path.go
Expand Up @@ -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)
}

0 comments on commit 3d3d539

Please sign in to comment.