summaryrefslogtreecommitdiff
path: root/vendor/github.com/blang/vfs/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/blang/vfs/path.go')
-rw-r--r--vendor/github.com/blang/vfs/path.go29
1 files changed, 0 insertions, 29 deletions
diff --git a/vendor/github.com/blang/vfs/path.go b/vendor/github.com/blang/vfs/path.go
deleted file mode 100644
index 722e2497..00000000
--- a/vendor/github.com/blang/vfs/path.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package vfs
-
-import (
- "strings"
-)
-
-// SplitPath splits the given path in segments:
-// "/" -> []string{""}
-// "./file" -> []string{".", "file"}
-// "file" -> []string{".", "file"}
-// "/usr/src/linux/" -> []string{"", "usr", "src", "linux"}
-// The returned slice of path segments consists of one more more segments.
-func SplitPath(path string, sep string) []string {
- path = strings.TrimSpace(path)
- path = strings.TrimSuffix(path, sep)
- if path == "" { // was "/"
- return []string{""}
- }
- if path == "." {
- return []string{"."}
- }
-
- if len(path) > 0 && !strings.HasPrefix(path, sep) && !strings.HasPrefix(path, "."+sep) {
- path = "./" + path
- }
- parts := strings.Split(path, sep)
-
- return parts
-}