summaryrefslogtreecommitdiff
path: root/match/file.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2019-07-05 14:58:49 +0300
committerEyal Posener <[email protected]>2019-07-05 17:29:25 +0300
commit29f43e246ec41ee311a0a9bc24b15cb4ece4e513 (patch)
treea89a2f4ae80897cb9a1f5f98f702ca2d8210731c /match/file.go
parentf71e6baaf2e0d387a847f8e599af7d75be650283 (diff)
deprecate match package
Diffstat (limited to 'match/file.go')
-rw-r--r--match/file.go19
1 files changed, 0 insertions, 19 deletions
diff --git a/match/file.go b/match/file.go
deleted file mode 100644
index 051171e..0000000
--- a/match/file.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package match
-
-import "strings"
-
-// File returns true if prefix can match the file
-func File(file, prefix string) bool {
- // special case for current directory completion
- if file == "./" && (prefix == "." || prefix == "") {
- return true
- }
- if prefix == "." && strings.HasPrefix(file, ".") {
- return true
- }
-
- file = strings.TrimPrefix(file, "./")
- prefix = strings.TrimPrefix(prefix, "./")
-
- return strings.HasPrefix(file, prefix)
-}